Re: BUG #17542: tsquery returns incorrect results with nested, conjuncted followed-by operators
От | Pavel Borisov |
---|---|
Тема | Re: BUG #17542: tsquery returns incorrect results with nested, conjuncted followed-by operators |
Дата | |
Msg-id | CALT9ZEHmajgi1mc9-2VRPLzmvs_n26mSmgXxD4yGY2p9oEf7_w@mail.gmail.com обсуждение исходный текст |
Ответ на | BUG #17542: tsquery returns incorrect results with nested, conjuncted followed-by operators (PG Bug reporting form <noreply@postgresql.org>) |
Ответы |
Re: BUG #17542: tsquery returns incorrect results with nested, conjuncted followed-by operators
|
Список | pgsql-bugs |
Consider the following query:
jordan=> select '((a <2> c) & (b <-> c)) <-> d'::tsquery @@ 'a:1 b:2 c:3
d:4';
?column?
----------
f
(1 row)
I think this should return "true", because both of the expressions on the
left-hand-side of the outer <-> operator of the tsquery do in fact precede
the "d" term in the tsvector.
Here is output that shows this:
jordan=> select '((a <2> c)) <-> d'::tsquery @@ 'a:1 b:2 c:3 d:4';
?column?
----------
t
(1 row)
jordan=> select '((b <-> c)) <-> d'::tsquery @@ 'a:1 b:2 c:3 d:4';
?column?
----------
t
(1 row)
I think things go wrong in the query executor because the two LHS clauses
have different widths.
Do you agree that this is incorrect output?
I guess this result is derived from the agreement that logical operation inside the phrase operator is treated as
"both operands a and b are in the _same_ position just before c".
select '(a & b) <-> c'::tsquery @@ 'a:1 b:1 c:2';
?column?
----------
t
(1 row)
?column?
----------
t
(1 row)
Though it's not clear what it means if there is another phrase operator inside logical. Result positions of (a <2> c) and (b <-> c) are different, I guess. It's not clear to me how should this behave in the case of a chain of nested phrase-logical-phrase operations.
Best regards,
Pavel Borisov
Pavel Borisov
В списке pgsql-bugs по дате отправления: