Behaviour of to_tsquery(stopwords only)

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Behaviour of to_tsquery(stopwords only)
Дата
Msg-id 47CFC514.6030800@archonet.com
обсуждение исходный текст
Ответы Re: Behaviour of to_tsquery(stopwords only)  (Richard Huxton <dev@archonet.com>)
Список pgsql-hackers
I'm not sure what value a tsquery has if it's composed from stopwords 
only, but it doesn't seem to be null or equal to itself.

That strikes me as ... unintuitive, although I'm happy to be re-educated 
on this.

I think it's because CompareTSQ (tsquery_op.c, line 142) doesn't have a 
case to handle query sizes of zero. That's what seems to be returned 
from tsearch/to_tsany.c lines ~ 345-350.


SELECT  qid,words,query,  (query is null) AS isnull,  (query = to_tsquery(words)) as issame
FROM  util.queries
ORDER BY qid DESC LIMIT 5;

NOTICE:  text-search query contains only stop words or doesn't contain 
lexemes, ignored
NOTICE:  text-search query contains only stop words or doesn't contain 
lexemes, ignored qid  |  words   |   query    | isnull | issame
------+----------+------------+--------+-------- 1000 | to       |            | f      | f  999 | or       |
|f      | f  998 | requests | 'request'  | f      | t  997 | site     | 'site'     | f      | t  996 | document |
'document'| f      | t
 
(5 rows)

--   Richard Huxton  Archonet Ltd


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

Предыдущее
От: "Pavan Deolasee"
Дата:
Сообщение: Re: 8.3.0 Core with concurrent vacuum fulls
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: Behaviour of to_tsquery(stopwords only)