the relevance-boosted original term needs a prefix too
This commit is contained in:
parent
238cd56d6c
commit
ff48af310d
@ -1,5 +1,5 @@
|
|||||||
#ifndef lint
|
#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
|
#endif
|
||||||
/*
|
/*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -195,7 +195,7 @@ void StringToXapianQ::maybeStemExp(bool nostemexp,
|
|||||||
string &sterm)
|
string &sterm)
|
||||||
{
|
{
|
||||||
LOGDEB2(("maybeStemExp: term [%s] stemlang [%s] nostemexp %d\n",
|
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();
|
sterm.erase();
|
||||||
if (term.empty()) {
|
if (term.empty()) {
|
||||||
exp.clear();
|
exp.clear();
|
||||||
@ -356,9 +356,9 @@ bool StringToXapianQ::translate(const string &iq,
|
|||||||
Xapian::Query xq(Xapian::Query::OP_OR,
|
Xapian::Query xq(Xapian::Query::OP_OR,
|
||||||
exp.begin(), exp.end());
|
exp.begin(), exp.end());
|
||||||
// Give a relevance boost to the original term
|
// 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(Xapian::Query::OP_OR,
|
||||||
xq, Xapian::Query(sterm, 10));
|
xq, Xapian::Query(prefix+sterm, 10));
|
||||||
}
|
}
|
||||||
pqueries.push_back(xq);
|
pqueries.push_back(xq);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user