Expand description
Recursive-descent parser for PostgreSQL tsquery boolean syntax.
Supported grammar (left-recursive precedence, lowest-to-highest):
query ::= or_expr
or_expr ::= and_expr ( '|' and_expr )*
and_expr::= not_expr ( '&' not_expr )*
not_expr::= '!' not_expr | atom
atom ::= '(' query ')'
| term ':*' (prefix)
| term (plain)A term is any contiguous non-operator, non-paren token.
phraseto_tsquery is handled via parse_phrase_terms — the result is
always FtsQuery::Phrase, which the executor rejects with Unsupported.
Functions§
- parse_
phrase_ terms - Build an
FtsQuery::Phrasefrom whitespace-separated terms. - parse_
tsquery - Parse a PG
tsquerystring into anFtsQuerytree.