Hi all,
I have recently discovered an unexpected difference in behaviour using websearch_to_tsquery() with quoted strings containing ampersands.
These two queries are equivalent without surrounding double quotes
select websearch_to_tsquery('something and another') = websearch_to_tsquery('something & another');
With surrounding double quotes they produce subtly different queries, with different positional information.
select websearch_to_tsquery('"something & another"'); I imagine the difference is due to the ts_vector type recording different information for the underlying strings.
This leads to quite different search results and my current workaround is to suggest to users to do both searches with an OR. Is this the right solution?
Best regards,
Alastair
|