[Xapian-discuss] Phrase search problem

Olly Betts olly at survex.com
Wed Jul 20 14:24:00 BST 2011


On Wed, Jul 20, 2011 at 09:14:03AM -0300, Bruno Rezende wrote:
> if I search for 'curtain curtain' and there are documents that matches
> the query, they aren't returned. But, if I search for 'curtain nice
> curtain' and there are documents that matches this query, it works ok.

If you look at the positional information for curtain in document 1 with
delve, you'll notice it only occurs once:

$ delve /tmp/tmplLEyRQ/ -r1 -tcurtain
Position List for term `curtain', record #1: 1

Your issue is that you are trying to add curtain at positions 0 and 1,
but position 0 isn't getting set, so you only actually add it at
position 1.  Simply adding one to tpos seems to avoid this problem.

This is pretty clearly a bug, but I'm not certain where it goes wrong
yet.  It is an indexing issue though.

(Incidentally, for more tips on debugging this sort of situation, see:
http://trac.xapian.org/wiki/FAQ/NoMatches )

> I tried running this
> same program in the xapian that comes with Ubuntu (1.0.20) and it
> doesn't work since chert is not available.

You can just change "xapian.chert_open" to "xapian.WritableDatabase" -
unless there's a reason why you wanted chert, it's better to use the
non-specific form.

Cheers,
    Olly



More information about the Xapian-discuss mailing list