snippets: allow a little more contiguous expansion of current snippet

This commit is contained in:
Jean-Francois Dockes 2019-07-06 08:26:42 +02:00
parent 8b14fc8331
commit 6cd2c9e2ca

View File

@ -206,7 +206,7 @@ public:
#endif #endif
m_curfragcoef += coef; m_curfragcoef += coef;
m_remainingWords = m_ctxwords + 1; m_remainingWords = m_ctxwords + 1;
if (m_extcount > 3) { if (m_extcount > 5) {
// Limit expansion of contiguous fragments (this is to // Limit expansion of contiguous fragments (this is to
// avoid common terms in search causing long // avoid common terms in search causing long
// heavyweight meaningless fragments. Also, limit length). // heavyweight meaningless fragments. Also, limit length).
@ -474,13 +474,14 @@ int Query::Native::abstractFromText(
inslen += endhit.size(); inslen += endhit.size();
} }
#endif #endif
LOGDEB0("=== FRAGMENT: Coef: " << entry.coef << ": " << frag << endl);
int page = 0; int page = 0;
if (vpbreaks.size() > 1) { if (vpbreaks.size() > 1) {
page = ndb->getPageNumberForPosition(vpbreaks, entry.hitpos); page = ndb->getPageNumberForPosition(vpbreaks, entry.hitpos);
if (page < 0) if (page < 0)
page = 0; page = 0;
} }
LOGDEB0("=== FRAGMENT: p. " << page << " Coef: " << entry.coef <<
": " << frag << endl);
vabs.push_back(Snippet(page, frag).setTerm(entry.term)); vabs.push_back(Snippet(page, frag).setTerm(entry.term));
if (count++ >= maxtotaloccs) if (count++ >= maxtotaloccs)
break; break;