cancel
Showing results for 
Search instead for 
Did you mean: 

How can I make fulltext search accent insensitive?

Laurent_Doguin
Star Collaborator
Star Collaborator

I would like to have the same search result when I type either 'Hôtel' or 'Hotel'.

1 ACCEPTED ANSWER

Laurent_Doguin
Star Collaborator
Star Collaborator

This can be achieved easily if you are using PostgreSQL 9.0 and above through the unaccent contribution (http://www.postgresql.org/docs/9.0/static/unaccent.html).

Install the unaccent contribution by running the unaccent.sql script. For Ubuntu users, this file is located at /usr/share/postgresql/9.0/contrib/unaccent.sql

Connect to your database and run the following instructions:

CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french );
ALTER TEXT SEARCH CONFIGURATION fr
    ALTER MAPPING FOR asciihword, asciiword, hword_asciipart, hword, hword_part, word
    WITH unaccent, french_stem;

Then replace in your default-repository-config.xml file the french analyzer by the one you just defined (fr in this example).

View answer in original post

2 REPLIES 2

Laurent_Doguin
Star Collaborator
Star Collaborator

This can be achieved easily if you are using PostgreSQL 9.0 and above through the unaccent contribution (http://www.postgresql.org/docs/9.0/static/unaccent.html).

Install the unaccent contribution by running the unaccent.sql script. For Ubuntu users, this file is located at /usr/share/postgresql/9.0/contrib/unaccent.sql

Connect to your database and run the following instructions:

CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french );
ALTER TEXT SEARCH CONFIGURATION fr
    ALTER MAPPING FOR asciihword, asciiword, hword_asciipart, hword, hword_part, word
    WITH unaccent, french_stem;

Then replace in your default-repository-config.xml file the french analyzer by the one you just defined (fr in this example).

Sun_Seng_David_
Champ on-the-rise
Champ on-the-rise

If using Postgres 8.4, you can find in the documentation the instructions to build the unaccent module: http://doc.nuxeo.com/display/ADMINDOC/Configuring+PostgreSQL#ConfiguringPostgreSQL-Accentinsensitive...

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.