When enabling full text search, it could be convenient to let PostgreSQL search without accents.
This can be enabled using the right text search engines.
Here's some instruction:
When one gets this:
One needs to install the progresql contrib package or build postgresql with 'make world'.
Now, to enable full text search without accents, the following can be done:
Next in postgresql.conf enable the new text search configuration:
And restart the postgresql service.
Now
will result in
instead of
See the accent on the 'r'.
This can be enabled using the right text search engines.
Here's some instruction:
When one gets this:
Code:
crm_divertimento=# create extension unaccent; ERROR: extension "unaccent" is not available
Now, to enable full text search without accents, the following can be done:
Code:
crm_divertimento=# create extension unaccent; CREATE EXTENSION crm_divertimento=# show default_text_search_config; default_text_search_config ---------------------------- pg_catalog.dutch (1 row) crm_divertimento=# create text search configuration dutch_unaccented(COPY = dutch); CREATE TEXT SEARCH CONFIGURATION crm_divertimento=# alter text search configuration dutch_unaccented alter mapping for hword, hword_part, word with unaccent, dutch_stem; ALTER TEXT SEARCH CONFIGURATION
Next in postgresql.conf enable the new text search configuration:
Code:
(...) # default configuration for text search default_text_search_config = 'pg_catalog.dutch_unaccented' (...)
Now
Code:
to_tsvector('dutch_unaccented', 'Dvořák, Antonín - Carnival Overture, op.92, B.169 (Karneval)')
Code:
'antonin':2 'b.169':6 'carnival':3 'dvorak':1 'karneval':7 'op.92':5 'overtur':4
Code:
'antonin':2 'b.169':6 'carnival':3 'dvořak':1 'karneval':7 'op.92':5 'overtur':4