← Back to team overview

launchpad-dev team mailing list archive

Re: RFC: Should we keep the logical operators "&|!-" as full text search operators?

 

On 17.07.2012 18:58, Aaron Bentley wrote:
> On 12-07-17 11:38 AM, Abel Deuring wrote:
>> I see two options to fix this bug:
> 
>> (A) We can either fix the immediate problem (the fix would be
>> quite simple) and keep the feature "treat the characters '&|!' as
>> logical operators in full text searches".
> 
>> (B) Let ftq() simply remove "&|!" from queries.
> 
> Why not (C) leave &|! in the queries, but treat them as text instead
> of booleans operators?

Sorry, I did not described completely how a full text search works:

The stored procedure ftq() prepares the search string given by a user so
that it can be passed to the Postgres function to_tsquery(), which
expects a syntactically correct search expression, where "syntactically
correct" means, amongst a few other things, that words must be separated
by operators, and these operators are the symbols "&|!".

Currently, we have the bug that ftq() does not properly process for
example the string "?!.". to_tsquery()  returns a syntax error for this
string because a binary operator (& or |) is missing between the "?" and
the "!".

In other words, (c) would required to replace the parser used by
to_tsquery(). I think that would require too much effort.


References