Re: Full text search randomly not working for short prefixes?

Поиск
Список
Период
Сортировка
Искать
От
Andreas Joseph Krogh
Тема
Re: Full text search randomly not working for short prefixes?
Дата
Msg-id
VisenaEmail.78.132a01af48ad9505.158c07e1c23@tc7-visena
Ответ на
Список
Дерево обсуждения
Full text search randomly not working for short prefixes? cen <imbacen@gmail.com>
Re: Full text search randomly not working for short prefixes? Tom Lane <tgl@sss.pgh.pa.us>
Re: Full text search randomly not working for short prefixes? cen <imbacen@gmail.com>
Re: Full text search randomly not working for short prefixes? Andreas Joseph Krogh <andreas@visena.com>
På fredag 02. desember 2016 kl. 16:33:12, skrev Tom Lane <tgl@sss.pgh.pa.us>:
cen <imbacen@gmail.com> writes:
> Something funny going on with my full text search.. and I have no idea what.

The way to debug this sort of thing is generally to look at what tsquery
you're actually getting.  I get

regression=# select to_tsquery(unaccent('a:*'));
NOTICE:  text-search query contains only stop words or doesn't contain lexemes, ignored
 to_tsquery
------------
 
(1 row)

regression=# select to_tsquery(unaccent('an:*'));
NOTICE:  text-search query contains only stop words or doesn't contain lexemes, ignored
 to_tsquery
------------
 
(1 row)

regression=# select to_tsquery(unaccent('ana:*'));
 to_tsquery
------------
 'ana':*
(1 row)

Of course, only the last is going to match 'ana'.

So you need to use a text search configuration in which a/an are
not stop words.  Or possibly you could cast the unaccent result
directly to tsquery rather than passing it through to_tsquery(),
though likely that would just have a different set of failure modes
with queries where you do wish stemming would occur.

The problem with "no" seems to be the same.
 
One can always specify 'simple' as the config, eliminating any "stop-wprd smartness":
 
andreak=> select to_tsquery('simple', 'a:*');  
to_tsquery  
------------
'a':*
(1 row)


 
--
Andreas Joseph Krogh
В списке pgsql-general по дате отправления
От: cen
Дата:
От: Tom DalPozzo
Дата:
FAQ