From 50ee2838dc046edfc1079a7dc0e4c02acbf18c51 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Sat, 7 Jun 2014 11:44:04 +0200 Subject: [PATCH] Use a single Xapian Database object for update and query operations while indexing instead of separately open read/write ones. Separate objects seem to trigger Xapian issues --- src/rcldb/rcldb.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/rcldb/rcldb.cpp b/src/rcldb/rcldb.cpp index 34148bae..39c846c7 100644 --- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -781,12 +781,16 @@ bool Db::open(OpenMode mode, OpenError *error) #ifdef IDX_THREADS m_ndb->maybeStartThreads(); #endif - // We open a readonly object in all cases (possibly in - // addition to the r/w one) because some operations - // are faster when performed through a Database: no - // forced flushes on allterms_begin(), ie, used in - // subDocs() - m_ndb->xrdb = Xapian::Database(dir); + // We used to open a readonly object in addition to + // the r/w one because some operations were faster + // when performed through a Database: no forced + // flushes on allterms_begin(), used in + // subDocs(). This issue has been gone for a long time + // (now: Xapian 1.2) and the separate objects seem to + // trigger other Xapian issues, so the query db is now + // a clone of the update one. +// m_ndb->xrdb = Xapian::Database(dir); + m_ndb->xrdb = m_ndb->xwdb; LOGDEB(("Db::open: lastdocid: %d\n", m_ndb->xwdb.get_lastdocid())); LOGDEB2(("Db::open: resetting updated\n"));