[Xapian-discuss] Phrase search problem

Bruno Rezende brunovianarezende at gmail.com
Wed Jul 20 15:18:05 BST 2011


Hi,

On Wed, Jul 20, 2011 at 10:24 AM, Olly Betts <olly at survex.com> wrote:
> 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.
>

thanks for the info, adding one to tpos really fixed the 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 )

thanks for the link, I'll use it when/if I have this kind of problem again.

>
>> 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.
>

ok, I changed it and the problem does happen in 1.0.20 too. Attached
there is a new version of the program I sent earlier, but now in unit
test style, maybe it can be useful.

-- 
Bruno
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phrasesearch.py
Type: text/x-python
Size: 2042 bytes
Desc: not available
URL: <http://lists.xapian.org/pipermail/xapian-discuss/attachments/20110720/b9fda78e/attachment.py>


More information about the Xapian-discuss mailing list