pmatseykanets / laravel-scout-postgres

PostgreSQL Full Text Search Engine for Laravel Scout
MIT License
159 stars 35 forks source link

Some support for ignoring accentuation? #34

Open neylsongularte opened 4 years ago

neylsongularte commented 4 years ago

"numeros" and "números" not match

neylsongularte commented 4 years ago

My solution:

DB::statement('CREATE EXTENSION unaccent;');
DB::statement('CREATE TEXT SEARCH CONFIGURATION pt ( COPY = portuguese );');
DB::statement('ALTER TEXT SEARCH CONFIGURATION pt ALTER MAPPING FOR hword, hword_part, word WITH unaccent, portuguese_stem;');
DB::statement("ALTER DATABASE ${db} SET default_text_search_config TO pt");

Remove accent from /usr/share/postgresql/9.6/tsearch_data/portuguese.stop

neylsongularte commented 4 years ago

Souce: https://www.infoq.com/br/articles/postgresql-fts/ https://gist.github.com/rach/9289959