On Tue, Nov 15, 2005 at 06:23:53PM -0800, Philip Neustrom
wrote:> How can I make Xapian return only results that contain the exact query
> string? I want users to be able to "quote a string" and have
that
> return only matches that contain that exact query. What's the best
> way to do this?
Make sure you have built the index with positional information (use
Document::add_posting when indexing free text rather than
Document::add_term).
Then at search time, create a PHRASE query for the quoted string. The
QueryParser class can handle this (and other common query parsing tasks)
for you.
Cheers,
Olly