Full text search - wildcard and a stop word
От | Allan Jardine |
---|---|
Тема | Full text search - wildcard and a stop word |
Дата | |
Msg-id | CAAMbBLtckoNmFp6irVXsKcZufM6_DiQGN2vtHhWVgofESsE11g@mail.gmail.com обсуждение исходный текст |
Ответы |
Re: Full text search - wildcard and a stop word
|
Список | pgsql-general |
Hi all,
I'm venturing into full text search in Postgres for the first time, and I'd like to be able to do a search by the start of a word - so I used the `:*` operator. However, this doesn't operate as I'd expect with a stop word - for example, my name is "Allan" so I often use it as a test string. It contains `all` which is a stop word, which is how I noticed this issue.
To illustrate:
=> select to_tsquery('al:*');
to_tsquery
------------
'al':*
(1 row)
=> select to_tsquery('all:*');
NOTICE: text-search query contains only stop words or doesn't contain lexemes, ignored
to_tsquery
------------
(1 row)
=> select to_tsquery('alla:*');
to_tsquery
------------
'alla':*
(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? I'm using Postgres 12.10.
Thanks,
Allan
To illustrate:
=> select to_tsquery('al:*');
to_tsquery
------------
'al':*
(1 row)
=> select to_tsquery('all:*');
NOTICE: text-search query contains only stop words or doesn't contain lexemes, ignored
to_tsquery
------------
(1 row)
=> select to_tsquery('alla:*');
to_tsquery
------------
'alla':*
(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? I'm using Postgres 12.10.
Thanks,
Allan
В списке pgsql-general по дате отправления: