field values were not used in case term expansion was not performed (phrase or capitalized term)
This commit is contained in:
parent
9f00432fb7
commit
8ddea418aa
@ -267,7 +267,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
void expandTerm(bool dont, const string& term, list<string>& exp,
|
void expandTerm(bool dont, const string& term, list<string>& exp,
|
||||||
string& sterm, string *prefix);
|
string& sterm, string *prefix = 0);
|
||||||
// After splitting entry on whitespace: process non-phrase element
|
// After splitting entry on whitespace: process non-phrase element
|
||||||
void processSimpleSpan(const string& span, bool nostemexp, list<Xapian::Query> &pqueries);
|
void processSimpleSpan(const string& span, bool nostemexp, list<Xapian::Query> &pqueries);
|
||||||
// Process phrase/near element
|
// Process phrase/near element
|
||||||
@ -313,8 +313,8 @@ void StringToXapianQ::expandTerm(bool nostemexp,
|
|||||||
list<string>& exp,
|
list<string>& exp,
|
||||||
string &sterm, string *prefix)
|
string &sterm, string *prefix)
|
||||||
{
|
{
|
||||||
LOGDEB2(("expandTerm: term [%s] stemlang [%s] nostemexp %d\n",
|
LOGDEB2(("expandTerm: field [%s] term [%s] stemlang [%s] nostemexp %d\n",
|
||||||
term.c_str(), m_stemlang.c_str(), nostemexp));
|
m_field.c_str(), term.c_str(), m_stemlang.c_str(), nostemexp));
|
||||||
sterm.erase();
|
sterm.erase();
|
||||||
exp.clear();
|
exp.clear();
|
||||||
if (term.empty()) {
|
if (term.empty()) {
|
||||||
@ -329,10 +329,15 @@ void StringToXapianQ::expandTerm(bool nostemexp,
|
|||||||
|
|
||||||
if (nostemexp && !haswild) {
|
if (nostemexp && !haswild) {
|
||||||
// Neither stemming nor wildcard expansion: just the word
|
// Neither stemming nor wildcard expansion: just the word
|
||||||
|
string pfx;
|
||||||
|
if (!m_field.empty())
|
||||||
|
m_db.fieldToPrefix(m_field, pfx);
|
||||||
sterm = term;
|
sterm = term;
|
||||||
m_uterms.push_back(sterm);
|
m_uterms.push_back(sterm);
|
||||||
exp.push_front(term);
|
exp.push_front(pfx+term);
|
||||||
exp.resize(1);
|
exp.resize(1);
|
||||||
|
if (prefix)
|
||||||
|
*prefix = pfx;
|
||||||
} else {
|
} else {
|
||||||
list<TermMatchEntry> l;
|
list<TermMatchEntry> l;
|
||||||
if (haswild) {
|
if (haswild) {
|
||||||
@ -436,8 +441,7 @@ void StringToXapianQ::processPhraseOrNear(wsQData *splitData,
|
|||||||
|
|
||||||
string sterm;
|
string sterm;
|
||||||
list<string>exp;
|
list<string>exp;
|
||||||
string prefix;
|
expandTerm(nostemexp, *it, exp, sterm);
|
||||||
expandTerm(nostemexp, *it, exp, sterm, &prefix);
|
|
||||||
groups.push_back(vector<string>(exp.begin(), exp.end()));
|
groups.push_back(vector<string>(exp.begin(), exp.end()));
|
||||||
orqueries.push_back(Xapian::Query(Xapian::Query::OP_OR,
|
orqueries.push_back(Xapian::Query(Xapian::Query::OP_OR,
|
||||||
exp.begin(), exp.end()));
|
exp.begin(), exp.end()));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user