mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Make exact distance match for FTS phrase operator
Phrase operator now requires exact distance betweens lexems instead of less-or-equal. Per discussion c19fcfec308e6ccd952cdde9e648b505@mail.gmail.com
This commit is contained in:
@ -346,10 +346,10 @@ SELECT to_tsvector('error is not fatal') @@ to_tsquery('fatal <-> error');
|
||||
|
||||
There is a more general version of the FOLLOWED BY operator having the
|
||||
form <literal><<replaceable>N</>></literal>,
|
||||
where <replaceable>N</> is an integer standing for the greatest distance
|
||||
where <replaceable>N</> is an integer standing for the exact distance
|
||||
allowed between the matching lexemes. <literal><1></literal> is
|
||||
the same as <literal><-></>, while <literal><2></literal>
|
||||
allows one other lexeme to optionally appear between the matches, and so
|
||||
allows one other lexeme to appear between the matches, and so
|
||||
on. The <literal>phraseto_tsquery</> function makes use of this
|
||||
operator to construct a <literal>tsquery</> that can match a multi-word
|
||||
phrase when some of the words are stop words. For example:
|
||||
@ -1529,7 +1529,7 @@ SELECT to_tsquery('fat') <-> to_tsquery('cat | rat');
|
||||
<para>
|
||||
Returns a query that searches for a match to the first given query
|
||||
followed by a match to the second given query at a distance of at
|
||||
most <replaceable>distance</replaceable> lexemes, using
|
||||
<replaceable>distance</replaceable> lexemes, using
|
||||
the <literal><<replaceable>N</>></literal>
|
||||
<type>tsquery</> operator. For example:
|
||||
|
||||
|
Reference in New Issue
Block a user