Hello! Search with Lucene:
setlocale(LC_ALL, 'ru_RU.UTF-8'); Lucene\Analysis\Analyzer\Analyzer::setDefault( new Lucene\Analysis\Analyzer\Common\Utf8\CaseInsensitive()); $index = Lucene\Lucene::open($searchIndexLocation); $searchResults = $index->find($validatedQuery['searchQuery']);
Then the words should be highlighted by the search:
\ZendSearch\Lucene\Search\QueryParser::setDefaultEncoding('UTF-8'); $doc = Html::loadHTML($high, false, $defaultEncoding = 'UTF-8'); $doc->highlight($validatedQuery['searchQuery'], $colour = '#66ffff'); $highlightedHTML=$doc->getHTMLBody();
With the English text, everything works fine, but with Russian words either are not highlighted at all, or individual letters are highlighted in other words that do not match the query. And if the request begins with a capital Russian letter, then the search does not work at all. What can be wrong? Thank.