I'm having a few problems getting phrase searching to work. This is the query : Xapian::Query((perl:(pos=1) PHRASE 2 lamp:(pos=2))) Generated by query parser from "perl lamp" Unfortunately it seems to return me documents with perl AND lamp even when they are not adjacent. Should the terms be next to each other in the term iterator? For one document I get perl at position 539 and lamp at 412. Cheers, Jeremy -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ .
On Fri, Oct 14, 2005 at 07:42:24AM -0400, tech@dbx.co.uk wrote:> Xapian::Query((perl:(pos=1) PHRASE 2 lamp:(pos=2))) > > Generated by query parser from "perl lamp" > > Unfortunately it seems to return me documents with perl AND lamp even when > they are not adjacent.Did you index with positional information? If there's no positional information in the database then PHRASE is converted to AND (which seems more useful than matching nothing, which is what we used to do...) The delve tool in the examples subdirectory is a good way of checking this sort of thing. Cheers, Olly
RTFM :( The rest of the system is going pretty well, there's some danger of going live with it. Thanks Olly Original Message: ----------------- From: Olly Betts olly@survex.com Date: Fri, 14 Oct 2005 13:01:29 +0100 To: tech@dbx.co.uk, xapian-discuss@lists.xapian.org Subject: Re: [Xapian-discuss] Phrase Searching On Fri, Oct 14, 2005 at 07:42:24AM -0400, tech@dbx.co.uk wrote:> Xapian::Query((perl:(pos=1) PHRASE 2 lamp:(pos=2))) > > Generated by query parser from "perl lamp" > > Unfortunately it seems to return me documents with perl AND lamp even when > they are not adjacent.Did you index with positional information? If there's no positional information in the database then PHRASE is converted to AND (which seems more useful than matching nothing, which is what we used to do...) The delve tool in the examples subdirectory is a good way of checking this sort of thing. Cheers, Olly -------------------------------------------------------------------- mail2web - Check your email from the web at http://mail2web.com/ .