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? -- Mit freundlichen Gr??en Felix Antonius Wilhelm Ostmann -------------------------------------------------- Websuche Search Technology GmbH & Co. KG Martinistra?e 3 - D-49080 Osnabr?ck - Germany Tel.: +49 541 40666-0 - Fax: +49 541 40666-22 Email: info@websuche.de - Website: www.websuche.de -------------------------------------------------- AG Osnabr?ck - HRA 200252 - Ust-Ident: DE814737310 Komplement?rin: Websuche Search Technology Verwaltungs GmbH - AG Osnabr?ck - HRB 200359 Gesch?ftsf?hrer: Diplom Kaufmann Martin Steinkamp --------------------------------------------------
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? >
Alexander Lind schrieb:> 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.i can do the same ... but this would be not perfect for my scenario :( the filename is the doc_id and i dont want to rename millions of documents during indexing or creating symlinks.> > 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? >> > >-- Mit freundlichen Gr??en Felix Antonius Wilhelm Ostmann -------------------------------------------------- Websuche Search Technology GmbH & Co. KG Martinistra?e 3 - D-49080 Osnabr?ck - Germany Tel.: +49 541 40666-0 - Fax: +49 541 40666-22 Email: info@websuche.de - Website: www.websuche.de -------------------------------------------------- AG Osnabr?ck - HRA 200252 - Ust-Ident: DE814737310 Komplement?rin: Websuche Search Technology Verwaltungs GmbH - AG Osnabr?ck - HRB 200359 Gesch?ftsf?hrer: Diplom Kaufmann Martin Steinkamp --------------------------------------------------
On Fri, Jan 05, 2007 at 04:49:47PM +0100, Felix Antonius Wilhelm Ostmann wrote:> is there any way to decide the doc_id from one document?What happens if you use replace_document() instead of add_document()? J -- /--------------------------------------------------------------------------\ James Aylett xapian.org james@tartarus.org uncertaintydivision.org