teamtnt / laravel-scout-tntsearch-driver

Driver for Laravel Scout search package based on https://github.com/teamtnt/tntsearch
MIT License
1.1k stars 144 forks source link

Fuzzy search in persian words (utf-8) #179

Closed mahmoud-m-abadi closed 5 years ago

mahmoud-m-abadi commented 6 years ago

Hi, first of all, thanks a lot for this great package.

I need fuzzy search in Persian words and I couldn't find any solution about that. Please give me a trick about that. Thanks in advance.

Yarandi commented 5 years ago

Hi @mahmod2000 I did test the fuzzy search and this worked good. You should override fuzziness value in TNTSearch object.

        $tnt = new TNTSearch;
        $tnt->fuzziness = true;
        $posts = Post::search($request->get('search'))->get();

If you search "علوم" word , it will also return "علوی" if you have it in your indexed data. I hope it help you

mahmoud-m-abadi commented 5 years ago

Thanks dear, I will check it.