Hi Aleksandr,
> I agree with Aleksander about silencing all errors in
> websearch_to_tsquery().
>
> In the attachment is a revised patch with the attempt to introduce an
> ability to ignore syntax errors in gettoken_tsvector().
Thanks for the further improvements! Yes, you're both right, the API has
to be consistent. Unfortunately, I had to make some adjustments
according to Oleg Bartunov's review. Here's a change log:
1. &, | and (), <-> are no longer considered operators in web search
mode.
2. I've stumbled upon a bug: web search used to transform "pg_class"
into 'pg <-> class', which is no longer the case.
3. I changed the behavior of gettoken_tsvector() as soon as I had heard
from Aleksander Alekseev, so I decided to use my implementation in this
revision of the patch. This is a good subject for discussion, though.
Feel free to share your opinion.
4. As suggested by Theodor, I've replaced some bool args with bit flags.
> The name of enum ts_parsestate looks more like a name of the function
> than a name of a type.
> In my version, it renamed to QueryParserState, but you can fix it if
> I'm wrong.
True, but gettoken_query() returns ts_tokentype, so I decided to use
this naming scheme.
--
Dmitry Ivanov
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company