tsearch matching "barrier"
Vladimir Volovich <[email protected]>
| Newsgroups | gmane.comp.db.postgresql.openfts.general |
|---|---|
| Message-ID | <[email protected]> |
Greetings,
sometimes there is a need to make the @@ matcher only return true if
the matching text occurs in a logically connected part (e.g. a paragraph).
i.e. if i do "select ... where field @@ to_query(...)"
if the field contains e.g. an article, i want the match be found only if
one of the "paragraphs" matches, to avoid a situation of finding
some search term(s) in one part of the article, and other search term(s)
in a different part or the article.
it is possible to break the article into the logically connected parts
("paragraphs"), and index each of them separately, instead of putting
the whole article into the search index. but then, if several parts
("paragraphs") of the same article match the query, we will find
multiple records in the results, which actually correspond to the same
document, and thus we will need to specifically eliminate the duplicates.
therefore, a question: is there already a mechanism of putting a
"barrier" into the indexed field, i.e. a token which will divide the
text into logical parts, and then the matcher should only find those
records where one or more of the parts matches, but will not find a
match if the search terms are separated by such a "barrier"?
Best,
v.
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/