Ticket #271 (closed defect: fixed)

Opened 6 months ago

Last modified 6 months ago

Problem with OP_VALUE_LE and deleted document

Reported by: versmisse Owned by: olly
Priority: normal Milestone: 1.0.7
Component: Xapian-bindings Version: 1.0.6
Severity: normal Keywords:
Cc: Blocked By:
Operating System: All Blocking:

Description

Hello, i have a small problem with a Query and OP_VALUE_LE. Here, an example:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

from xapian import (WritableDatabase, DB_CREATE_OR_OPEN, Document, Query, Enquire, sortable_serialise, sortable_unserialise)

db = WritableDatabase('my_db', DB_CREATE_OR_OPEN)

doc1 = Document()
doc1.add_posting('foo1', 0)
doc1.add_value(0, sortable_serialise(1.0))

doc2 = Document()
doc2.add_posting('foo2', 0)
doc2.add_value(0, sortable_serialise(2.0))

db.add_document(doc1)
db.add_document(doc2)

db.delete_document('foo1')

enquire = Enquire(db)
enquire.set_query(Query(Query.OP_VALUE_LE, 0, sortable_serialise(1.5)))

for doc in enquire.get_mset(0,10):
    print sortable_unserialise(doc.get_document().get_value(0))

This code stops with a: xapian.DocNotFoundError?: Document 1 not found.

Thanks you in advance for your answer.

Best regards, David Versmisse.

Change History

Changed 6 months ago by richard

  • status changed from new to closed
  • resolution set to fixed

This issue is fixed in SVN (both in the 1.0 branch, and on trunk). The fix will be in the 1.0.7 release. I've just added a note to the wiki:ReleaseNotes/1.0.6 page about this.

Changed 6 months ago by richard

  • milestone set to 1.0.7
Note: See TracTickets for help on using tickets.