[Xapian-discuss] change the doc_id

Alexander Lind malte at webstay.org
Fri Jan 5 16:07:01 GMT 2007


I let my db make its own unique ID per index:able document, and then 
when the doc is inserted into the xapian index, I let xapian set its own 
doc_id and I then save xapians doc_id in the db with the relevant document.
Much easier and way less error prone than trying to keep the db:s and 
xapians unique id:s in synch, I believe.

Alec

Felix Antonius Wilhelm Ostmann wrote:
> is there any way to decide the doc_id from one document?
> something like:
>
> int id = 101;
> db.add_document(doc,id);
>
> i have one uniq_id like the doc_id and i want doc_id = uniq_id. when i 
> delete one uniq_id and i generate the index new i have a problem :( or 
> should i insert empty documents for deleted ids? or is this a bad idea 
> to use the doc_id, should i save my own uniq_id in a value and ignore 
> the doc_id in my system?
>



More information about the Xapian-discuss mailing list