[Xapian-discuss] Iterating through all the documents of a db

Olly Betts olly at survex.com
Sat Jun 25 14:54:22 BST 2005


On Fri, Jun 24, 2005 at 11:26:34PM -0400, Marco Tabini wrote:
> One other question--is the docid invariant? In other words, if I ever delete
> a document from a database, will its docid change?

Erm, if you delete a document it ceases to exist so no longer has a docid
to get changed!

But the docid of a deleted document won't be reused (new document ids
are allocated using a "high water mark"), and none of the other docids
will change.

> If I combine several databases together, will their docids change if
> there is duplication (i.e.: same docid across multiple dbs?).

When searching multiple databases, the document ids in the combined
database are formed by interleaving those in the individual databases.

So they aren't the same as the true docids, but for the same combination
of databases, the combined document ids are stable even if you add,
remove, or alter documents in the individual databases.

Cheers,
    Olly



More information about the Xapian-discuss mailing list