[Xapian-discuss] merge database and maintain order

Olly Betts olly at survex.com
Tue Mar 27 00:01:10 BST 2007


On Mon, Mar 26, 2007 at 06:15:02PM +0100, Mark Clarkson wrote:
> Unfortunately this patch does not work with Xapian 0.9.9 or 0.9.10 as
> these versions require a non-empty string argument to
> Database::postlist_begin.

Ah yes, it relies on the "all documents iterator" feature which isn't in
the 0.9 branch.

> I notice that the patch is in svn so I'm going
> to have to go with my nasty patch for now :-(, but hopefully 0.9.11 will
> be out soon?

I'm hoping there won't need to be a 0.9.11, but if there is it will be
bug-fixes and documentation improvements only.  But hopefully 1.0 will
be ready to release soon!

> Alternatively, I suppose I could add some term (Xall?) to every document
> in the database and use this in the call to postlist_begin(), which
> would be safer than my patch, unless there's another non brute force way
> of finding the lowest document id in a database?

Not via the API, but we have access to the internal classes here which
makes it easy.  This patch should work with 0.9 branch too, and also
trims unused docids from the end of each database (which makes no
difference in your situation, but is useful for some cases):

http://oligarchy.co.uk/xapian/patches/xapian-compact-trim-leading-and-trailing-unused-dids.patch

I think we should provide API methods to read the lowest and highest
docid actually used in a database - it may be useful in other
situations, and it's very easy to determine them if you have access to
the internal classes.  I'll look at adding them.

Cheers,
    Olly



More information about the Xapian-discuss mailing list