[Xapian-discuss] merge database and maintain order

Mark Clarkson mark.clarkson at smorg.co.uk
Sat Mar 24 22:05:34 GMT 2007


Hi,
Regarding the great note in the documentation:

  Note: If you add documents in strict date order, then
  a boolean search - i.e. set_weighting_scheme
  (Xapian::BoolWeight()) - with 
  set_docid_order(Xapian::Enquire::DESCENDING)
  is a very efficient way to perform "sort by date, newest first".

I've found through experimentation that merging databases maintains the
strict date order. In my case I have a 25 GB database, db1, and a daily
tiny database, db2. If I merge with 'xapian-compact db1 db2 dbnew' then
the date order is preserved in dbnew.

However I don't know how to maintain this date order when searching db1
and db2 together before merging, i.e. by adding both db1 and db2 to a
Database object and passing this to enquire. Is this possible?

Cheers
Mark. 




More information about the Xapian-discuss mailing list