From 9574030edc0a0bd67a7642c489f504b50fc75287 Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Thu, 14 Feb 2019 14:54:17 +0100 Subject: [PATCH] No need for boosting the original term if there was no expansion --- src/rcldb/searchdatatox.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rcldb/searchdatatox.cpp b/src/rcldb/searchdatatox.cpp index 8d39883d..61e9b5e7 100644 --- a/src/rcldb/searchdatatox.cpp +++ b/src/rcldb/searchdatatox.cpp @@ -620,11 +620,12 @@ void SearchDataClauseSimple::processSimpleSpan( // less wqf). This does not happen if there are wildcards anywhere // in the search. // We normally boost the original term in the stem expansion list. Don't - // do it if there are wildcards anywhere, this would skew the results. + // do it if there are wildcards anywhere, this would skew the results. Also + // no need to do it if there was no expansion. bool doBoostUserTerm = (m_parentSearch && !m_parentSearch->haveWildCards()) || (m_parentSearch == 0 && !m_haveWildCards); - if (doBoostUserTerm && !sterm.empty()) { + if (exp.size() > 1 && doBoostUserTerm && !sterm.empty()) { xq = Xapian::Query(Xapian::Query::OP_OR, xq, Xapian::Query(prefix+sterm, original_term_wqf_booster));