[Xapian-discuss] Bug: get_docid() and multiple databases
Olly Betts
olly at survex.com
Wed Jun 26 00:58:07 BST 2013
On Tue, Jun 25, 2013 at 11:44:46AM -0400, Jeff Rand wrote:
> I'm using the python bindings for xapian 1.2.12 and I'm getting some
> unexpected behavior which I believe is a bug. While searching multiple
> databases I am getting inconsistent values from doc.get_docid() when using
> an overloaded KeyMaker class for custom sorting. The id value in the
> document's data is the same as the id set for each document.
Thanks for the detailed report - I think this is indeed a bug.
Internally, we actually reuse a Xapian::Document object with a special
"ValueStreamDocument" internal (which avoids a lot of object creation and
destruction).
The ValueStreamDocument gets set up with the docid each time it is reused,
but ValueStreamDocument uses the docid in the shared database, whereas the
other document internals use the docid in the subdatabase. It is this
docid which Document::get_docid() returns.
This needs a bit of care in fixing to make sure we don't break anything
which currently works as intended...
Cheers,
Olly
More information about the Xapian-discuss
mailing list