Skip to content

Commit

Permalink
Merge pull request #254 from paveldanilin/bugfix/fuzzySearch
Browse files Browse the repository at this point in the history
Fix fuzzySearch substr -> mb_substr, since it does not work with russ…
  • Loading branch information
nticaric authored Sep 27, 2021
2 parents 3966ec6 + a6ce788 commit 1fd7b79
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/TNTSearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ public function getWordlistByKeyword($keyword, $isLastWord = false)
*/
public function fuzzySearch($keyword)
{
$prefix = substr($keyword, 0, $this->fuzzy_prefix_length);
$prefix = mb_substr($keyword, 0, $this->fuzzy_prefix_length);
$searchWordlist = "SELECT * FROM wordlist WHERE term like :keyword ORDER BY num_hits DESC LIMIT {$this->fuzzy_max_expansions}";
$stmtWord = $this->index->prepare($searchWordlist);
$stmtWord->bindValue(':keyword', mb_strtolower($prefix)."%");
Expand Down

0 comments on commit 1fd7b79

Please sign in to comment.