Re: [Xapian-discuss] Problem with merge / add database

roki roki rokiroki at gmx.net
Sat Aug 20 10:35:56 BST 2005


Thanks!

>     
> Quartzcompact renumbers documents when merging to avoid the risk of
> clashes, so won't preserve your docids.
> 
> If you actually want to merge two databases preserving docids, then
> you could take copydatabase.cc and tweak it to pass the existing docid
> when calling add_document.
> 
> > or use add_databse i got as result non existing doc_id's.
> 
> When you search multiple databases (using Database::add_database) then
> the docids in the combined database are remapped by interleaving those
> in the underlying database (again to avoid clashes).  But it's easy
> enough to map them back.
> 
> docid_merged = (docid - 1) * number_of_databases + database_number
> 
> where database_number is between 1 and number_of_databases
> 
> So:
> 
> docid = floor((docid_merged - 1) / number_of_databases) + 1
> 
> Cheers,
>     Olly
> 

-- 
Lust, ein paar Euro nebenbei zu verdienen? Ohne Kosten, ohne Risiko!
Satte Provisionen für GMX Partner: http://www.gmx.net/de/go/partner



More information about the Xapian-discuss mailing list