tntsearch
tntsearch copied to clipboard
Fuzzy search not work (Russian language tested)
Fuzzy search does not work. For example, I'm looking for “Керол” and there is “Кэрол” in the database, I expect to see the result, but TNTSearch does not find it.
My settings:
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'admin',
'username' => 'root',
'password' => '',
'storage' => 'tntsearch/',
'stemmer' => \TeamTNT\TNTSearch\Stemmer\PorterStemmer::class,//optional
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'fuzziness' => true,
'fuzzy' => [
'prefix_length' => 2,
'max_expansions' => 50,
'distance' => 2
],
'asYouType' => true,
'searchBoolean' => true
Hi. I have similar problem. My settings are:
`$tnt = new TNTSearch;
$tnt->fuzzy_distance=20;
$tnt->fuzziness = true;
$tnt->loadConfig([
'driver' => 'mysql',
'host' => 'localhost',
'database' => 'ses2',
'username' => 'root',
'password' => '',
'storage' => storage_path(),
'stemmer' => \TeamTNT\TNTSearch\Stemmer\PorterStemmer::class,//optional,
]);`
I want t o find a word $tnt->search("paszczek"); ///correct word is piszczek No results found.
Hi, is it working now?
'prefix_length' => 2
That's why you cannot find “Кэрол” typing “Керол”, because it's a typo in the second char.