Switch to side-by-side view
--- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -839,6 +839,16 @@ } } return adjustdbs(); +} + +// Determining what index a doc result comes from is based on the +// modulo of the docid against the db count. Ref: +// http://trac.xapian.org/wiki/FAQ/MultiDatabaseDocumentID +size_t Db::whatDbIdx(const Doc& doc) +{ + if (doc.xdocid == 0) + return (size_t)-1; + return doc.xdocid % m_extraDbs.size(); } bool Db::testDbDir(const string &dir)