tntsearch icon indicating copy to clipboard operation
tntsearch copied to clipboard

Fuzzy search not work (Russian language tested)

Open jun-dev opened this issue 5 years ago • 3 comments

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

jun-dev avatar Aug 15 '19 10:08 jun-dev

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.

michau85 avatar Sep 15 '19 07:09 michau85

Hi, is it working now?

gorlovka avatar Nov 26 '22 22:11 gorlovka

'prefix_length' => 2

That's why you cannot find “Кэрол” typing “Керол”, because it's a typo in the second char.

birdkiwi avatar Feb 13 '23 10:02 birdkiwi