[Xapian-discuss] having trouble with prefixes

Olly Betts olly at survex.com
Mon Sep 2 23:58:30 BST 2013


On Mon, Sep 02, 2013 at 03:42:25PM -0400, Christopher Harvey wrote:
> using almost exactly the same code as last time, I fed it the following
> query:
> path:"foo.bar"
> printing query.get_description() produces the following:
> Query is 'Xapian::Query((P:foo:(pos=1) PHRASE 2 P:bar:(pos=2)))'
> I was expecting a query with one term, since the "foo.bar" was
> quoted. Consequently I can't match terms stored in the database that
> have "." characters.

You want to set up path as a boolean prefix (since you don't want the
text after it to be word-split, stemmed, lower-cased, etc) - use
add_boolean_prefix() instead of add_prefix().

Cheers,
    Olly



More information about the Xapian-discuss mailing list