caub / pg-tsquery

:mag: Parse user input into a valid PostgreSQL tsquery
https://caub.github.io/pg-tsquery
58 stars 8 forks source link

Ending or starting query in `'` character produces invalid syntax #21

Open tommoor opened 1 year ago

tommoor commented 1 year ago

With the { singleQuoteReplacement: "&" } option the search term one' or 'one

…produces the invalid syntax:

one&

…I think the rule is too simplistic here?

caub commented 1 year ago

Would using the option added in https://github.com/caub/pg-tsquery/issues/14 help here?

tommoor commented 1 year ago

Sorry, edited the report – the issue is caused by that option.

caub commented 1 year ago

We added this singleQuoteReplacement option lately, and I added a comment about it that it should not be a reserved word

For example does it work for you to use a space ' ' or a a '+'?