cjk phrases: hopefully the right fix this time for slack computation. lastpos-termcount correction was applied twice
This commit is contained in:
parent
55545a7bdb
commit
ae3df4f7c3
@ -695,7 +695,7 @@ void SearchDataClauseSimple::processPhraseOrNear(Rcl::Db &db, string& ermsg,
|
|||||||
LOGDEB2("PHRASE/NEAR: alltermcount " << splitData->alltermcount() <<
|
LOGDEB2("PHRASE/NEAR: alltermcount " << splitData->alltermcount() <<
|
||||||
" lastpos " << splitData->lastpos() << "\n");
|
" lastpos " << splitData->lastpos() << "\n");
|
||||||
Xapian::Query xq(op, orqueries.begin(), orqueries.end(),
|
Xapian::Query xq(op, orqueries.begin(), orqueries.end(),
|
||||||
splitData->lastpos() + 1 + slack);
|
orqueries.size() + slack);
|
||||||
if (op == Xapian::Query::OP_PHRASE)
|
if (op == Xapian::Query::OP_PHRASE)
|
||||||
xq = Xapian::Query(Xapian::Query::OP_SCALE_WEIGHT, xq,
|
xq = Xapian::Query(Xapian::Query::OP_SCALE_WEIGHT, xq,
|
||||||
original_term_wqf_booster);
|
original_term_wqf_booster);
|
||||||
@ -706,10 +706,6 @@ void SearchDataClauseSimple::processPhraseOrNear(Rcl::Db &db, string& ermsg,
|
|||||||
HighlightData::TermGroup tg;
|
HighlightData::TermGroup tg;
|
||||||
tg.orgroups = groups;
|
tg.orgroups = groups;
|
||||||
tg.slack = slack;
|
tg.slack = slack;
|
||||||
if (splitData->lastpos() > splitData->alltermcount()) {
|
|
||||||
// Adjust for multiple pos per span (e.g. cjk)
|
|
||||||
tg.slack += splitData->lastpos() - splitData->alltermcount();
|
|
||||||
}
|
|
||||||
tg.grpsugidx = m_hldata.ugroups.size() - 1;
|
tg.grpsugidx = m_hldata.ugroups.size() - 1;
|
||||||
tg.kind = (op == Xapian::Query::OP_PHRASE) ?
|
tg.kind = (op == Xapian::Query::OP_PHRASE) ?
|
||||||
HighlightData::TermGroup::TGK_PHRASE :
|
HighlightData::TermGroup::TGK_PHRASE :
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user