PostgreSQL Full Text Search Spanish character Ñ

Viewed 1973

I am facing an issue when doing full text search with PostgreSQL on text that contains de Spanish character 'Ñ'

When I try to tokenize the Spanish word 'AÑO' (year) I get the following results depending on if input is upper or lower case:

SELECT to_tsvector('spanish','AÑO'),to_tsquery('spanish','año')
"to_tsvector"   "to_tsquery"
"'aÑo':1"   "'año'"

As you can see result is not the same and it is case sensitive, so it makes my application full text search queries case sensitive if they contain this character.

Is there any way to overcome this issue? I have been searching on PostgreSQL documentation about full text search, and I don't know how to change this behaviour on installed dictionaries.

Thank you so much. Martí

1 Answers
Related