From ff48af310d6553a4bfacebb5dbd3e95778bef364 Mon Sep 17 00:00:00 2001 From: dockes Date: Fri, 19 Jan 2007 10:23:27 +0000 Subject: [PATCH] the relevance-boosted original term needs a prefix too --- src/rcldb/searchdata.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/rcldb/searchdata.cpp b/src/rcldb/searchdata.cpp index 8daae5e4..b51a8626 100644 --- a/src/rcldb/searchdata.cpp +++ b/src/rcldb/searchdata.cpp @@ -1,5 +1,5 @@ #ifndef lint -static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.9 2007-01-18 12:09:58 dockes Exp $ (C) 2006 J.F.Dockes"; +static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.10 2007-01-19 10:23:26 dockes Exp $ (C) 2006 J.F.Dockes"; #endif /* * This program is free software; you can redistribute it and/or modify @@ -195,7 +195,7 @@ void StringToXapianQ::maybeStemExp(bool nostemexp, string &sterm) { LOGDEB2(("maybeStemExp: term [%s] stemlang [%s] nostemexp %d\n", - term.c_str(), m_stemlang.c_str(), nostemexp)); + term.c_str(), m_stemlang.c_str(), nostemexp)); sterm.erase(); if (term.empty()) { exp.clear(); @@ -356,9 +356,9 @@ bool StringToXapianQ::translate(const string &iq, Xapian::Query xq(Xapian::Query::OP_OR, exp.begin(), exp.end()); // Give a relevance boost to the original term - if (!sterm.empty()) { + if (exp.size() > 1 && !sterm.empty()) { xq = Xapian::Query(Xapian::Query::OP_OR, - xq, Xapian::Query(sterm, 10)); + xq, Xapian::Query(prefix+sterm, 10)); } pqueries.push_back(xq); }