[Xapian-discuss] xapian-compact 1.0.1

Tomasz Jackowiak tomasz.jackowiak at allegro.pl
Fri Jun 29 07:38:51 BST 2007


Olly Betts napisał(a):
> On Thu, Jun 28, 2007 at 05:23:50PM +0200, Tomasz Jackowiak wrote:
>> I'm using Xapian-core 1.0.1 and it seems that xapian-compact is 
>> reindexing documents' 'docid' even when merging only one database. I 
>> don't remember such behavior under version 0.9.9. Is it a feature or a 
>> bug? I can't find any information about that change.
> 
> It's a feature - this is the 1.0.0 NEWS file entry:
> 
> * xapian-compact: Now prunes unused docids off the start of each source
>   database's range of docids.
> 
> All document ids in a particular source database are translated by the
> same amount - actually renumbering to remove any gaps would be a lot
> more expensive, whereas eliminating a gap at the start is almost no
> extra work.
 >
 > If you have a rolling index where old documents are removed after a
 > while, this is useful even when compacting a single database as it 
keeps
 > the document ids small, which means the database ends up a bit smaller.

Thanks for explaining that.

> I can see it could be awkward if the docids are matched to an external
> database though.  It could be made optional if it's a problem for some
> uses.

I use Xapian from PHP as a replacement to MySQL full text search. The 
easiest way to update some data is to call replace_document(docid , 
&document) where the docid is a value of primary key from MySQL, 
because I don't need to store any other unique terms in documents. So 
it would be nice to have an option to disable renumbering in 
xapian-compact.

Thanks,
Tomek Jackowiak
-- 
Allegro.pl



More information about the Xapian-discuss mailing list