From 04f3449f990577f9d2206ac9daadb1cc49989f67 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Fri, 1 Feb 2019 09:07:28 +0100 Subject: [PATCH] Avoid multiple expansion of xapian term iterator --- src/rcldb/expansiondbs.cpp | 27 +++++++++++++++------------ src/rcldb/rclterms.cpp | 11 ++++++----- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/rcldb/expansiondbs.cpp b/src/rcldb/expansiondbs.cpp index a5b9bd9b..b2be23cf 100644 --- a/src/rcldb/expansiondbs.cpp +++ b/src/rcldb/expansiondbs.cpp @@ -18,7 +18,10 @@ #include "autoconfig.h" +#include "expansiondbs.h" + #include +#include #include "log.h" #include "utf8iter.h" @@ -28,7 +31,6 @@ #include "xmacros.h" #include "rcldb.h" #include "stemdb.h" -#include "expansiondbs.h" using namespace std; @@ -41,7 +43,7 @@ namespace Rcl { bool createExpansionDbs(Xapian::WritableDatabase& wdb, const vector& langs) { - LOGDEB("StemDb::createExpansionDbs: languages: " << (stringsToString(langs)) << "\n" ); + LOGDEB("StemDb::createExpansionDbs: languages: " <match(term)) continue; res.entries.push_back( - TermMatchEntry(*it, xdb.get_collection_freq(*it), + TermMatchEntry(ixterm, xdb.get_collection_freq(ixterm), it.get_termfreq())); // The problem with truncating here is that this is done