Thread: case and accent insensitive search under Python ?

case and accent insensitive search under Python ?

From
M4X
Date:
Hi,

I'm considering to migrate to postgresql... ( still examining the pro/con )

It seem that is possible to make a search that is case and accent
insensitive.

|I've dig https://www.postgresql.org/docs/current/textsearch-intro.html
and other resources,|

|but I didn't find yet an example that demonstrate it. (from Python
would be even better :) )

Just to see if it's easy to implement.
|

|Thanks.|

|Max
|

|
|




Re: case and accent insensitive search under Python ?

From
Tom Lane
Date:
M4X <77M1C@gmx.com> writes:
> It seem that is possible to make a search that is case and accent
> insensitive.
> |I've dig https://www.postgresql.org/docs/current/textsearch-intro.html
> and other resources,|
> |but I didn't find yet an example that demonstrate it.

The text search functionality is already case-insensitive, but not
accent-insensitive (at least in the common built-in configurations).
To make it accent-insensitive, you can set up a custom configuration
using the "unaccent" module.  See

https://www.postgresql.org/docs/current/unaccent.html

            regards, tom lane