Re: Full text search - wildcard and a stop word

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Full text search - wildcard and a stop word
Дата
Msg-id 705272.1645545383@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Full text search - wildcard and a stop word  (Allan Jardine <allan.jardine@sprymedia.co.uk>)
Список pgsql-general
Allan Jardine <allan.jardine@sprymedia.co.uk> writes:
> => select to_tsquery('all:*');
> NOTICE:  text-search query contains only stop words or doesn't contain
> lexemes, ignored
>  to_tsquery
> ------------
> (1 row)

> I get why that is happening - the notification basically details it, but
> the wildcard at the end seems to me that it should return `'all':*` in this
> case? Is this by design or could it be considered a bug?

It's a hard problem.  If we don't normalize the presented word, we risk
not matching cases that users would expect to match (because the word
is going to be compared to data that probably *was* normalized).

In this particular case, you can skip the normalization by just not
using to_tsquery:

n=# select 'all:*'::tsquery;
 tsquery 
---------
 'all':*
(1 row)

but that might or might not be what you want in general.

Perhaps the ideal behavior here would be "normalize, but don't throw away
stopwords", but unfortunately our dictionary APIs don't support that.

            regards, tom lane



В списке pgsql-general по дате отправления:

Предыдущее
От: Allan Jardine
Дата:
Сообщение: Full text search - wildcard and a stop word
Следующее
От: Torsten Förtsch
Дата:
Сообщение: AWS vs GCP storage