Обсуждение: case and accent insensitive search under Python ?

Поиск
Список
Период
Сортировка

case and accent insensitive search under Python ?

От
M4X
Дата:
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 ?

От
Tom Lane
Дата:
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