From c7d9d524f9761230be40e1c86469854870eda1bd Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 16 Apr 2013 15:56:49 +0200 Subject: [PATCH] add terms for doc md5s --- src/rcldb/rcldb.cpp | 12 +++++++----- src/sampleconf/fields | 1 + 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/rcldb/rcldb.cpp b/src/rcldb/rcldb.cpp index 37013a58..a4a54b4b 100644 --- a/src/rcldb/rcldb.cpp +++ b/src/rcldb/rcldb.cpp @@ -1129,13 +1129,15 @@ bool Db::addOrUpdate(const string &udi, const string &parent_udi, Doc &doc) RECORD_APPEND(record, string(cstr_mbreaks), multibreaks.str()); } - // If the file's md5 was computed, add value. This is optionally - // used for query result duplicate elimination. - string& md5 = doc.meta[Doc::keymd5]; - if (!md5.empty()) { + // If the file's md5 was computed, add value and term. + // The value is optionally used for query result duplicate elimination, + // and the term to find the duplicates. + const string *md5; + if (doc.peekmeta(Doc::keymd5, &md5) && !md5->empty()) { string digest; - MD5HexScan(md5, digest); + MD5HexScan(*md5, digest); newdocument.add_value(VALUE_MD5, digest); + newdocument.add_boolean_term(wrap_prefix("XM") + *md5); } LOGDEB0(("Rcl::Db::add: new doc record:\n%s\n", record.c_str())); diff --git a/src/sampleconf/fields b/src/sampleconf/fields index 2d013b87..0ec4d846 100644 --- a/src/sampleconf/fields +++ b/src/sampleconf/fields @@ -40,6 +40,7 @@ xapyearmon = M title = S ; wdfinc = 10 mtype = T ext = XE +rclmd5 = XM dir = XP abstract = XS filename = XSFN