Closed chris-82 closed 1 year ago
Hello! I had the same issue, fuzzy search wasn't working because of "$tnt->fuzziness = true;", "fuzziness" was considered as an undefined property by my IDE I tried "$tnt->fuzziness($data_to_search);" instead and now fuzzy search works. I don't know if it's the right way to deal with this issue, but it's working...
Try $tnt->fuzziness(true);
instead of $tnt->fuzziness = true;
. The attribute fuzziness doesn't exist on the TNTSearch class.
...
$tnt->loadConfig($config);
$tnt->selectIndex(ENV_SEARCHINDEX);
$tnt->fuzziness(true);
$search = "Regenerative";
$results = $tnt->search($search, 10);
...
Try
$tnt->fuzziness(true);
instead of$tnt->fuzziness = true;
. The attribute fuzziness doesn't exist on the TNTSearch class.... $tnt->loadConfig($config); $tnt->selectIndex(ENV_SEARCHINDEX); $tnt->fuzziness(true); $search = "Regenerative"; $results = $tnt->search($search, 10); ...
@alaminfirdows using fuzziness as method solved my problem! Thanks a lot :-)
Hi there,
I just installed tntsearch to a test project on an Ubuntu Server with PHP 8.1 to do some testing. But whatever I do or configure, there is never a result on a fuzzy search.
I build my index with this example:
My index file is beeing generated properly with several PHP warnings:
Deprecated: mb_strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/vendor/teamtnt/tntsearch/src/Support/Tokenizer.php on line 10
Now I search my index for "Regenerative" with this example script:
But when I search for "Regenrative" or "Regeneartive" I don't get any results at all. I tried different search terms and several fuzziness settings without success.
Is there anything that has to be configured when creating the index or can I check somehow, if the fuzzy-search is really active?!
Thanks for any advice.