nrtsearch
nrtsearch copied to clipboard
override lucene BaseFragmentsBuilder to fix a bug
https://github.com/Yelp/nrtsearch/issues/567 RP-7664
Fix a bug in lucene core, where the fragment end is calculated wrongly when using discreteMultiValue.
- overriding the buggy class with a fix in line https://github.com/Yelp/nrtsearch/pull/564/files#diff-df0e127b960bddcdd8d618e76351dc785218a9c8cbebcb6ba88b3d649401095aR157
- fragEnd ==> fragEnd - 1
- copied classes inherits the buggy class to the extend the new class
The changed test basically let the last field to be the best match, then the problem will show up if no such a fix. And the error message looks like
Expecting:
["Not all <em>food</em> are good <em>food</em>.",
"The <em>food</em> is good there, but the service is terrible. I"]
to contain exactly (and in same order):
["Not all <em>food</em> are good <em>food</em>.",
"The <em>food</em> is good there, but the service is terrible."]
but some elements were not found:
["The <em>food</em> is good there, but the service is terrible."]
and others were not expected:
["The <em>food</em> is good there, but the service is terrible. I"]
reported to Lucene-core https://github.com/apache/lucene/issues/12221