prioritizing aggregated DBs

Olly Betts olly at survex.com
Wed Feb 19 19:26:26 GMT 2020


On Wed, Feb 19, 2020 at 10:23:09AM +0000, Eric Wong wrote:
> Btw, is there a way to quickly figure out which sub-DB a retrieved
> document or mset item belongs to?

Yes: https://trac.xapian.org/wiki/FAQ/MultiDatabaseDocumentID

1.4.12 added a Database::size() method which reports the number of
shards - for older versions you have to keep track of that yourself
(which needs a little care as add_database() "flattens", so after
db1.add_database(db2) db1.size() will have increased by db2.size()
(which could be 0 if db2 has no shards).

Cheers,
    Olly



More information about the Xapian-discuss mailing list