nrtsearch icon indicating copy to clipboard operation
nrtsearch copied to clipboard

override lucene BaseFragmentsBuilder to fix a bug

Open waziqi89 opened this issue 1 year ago • 2 comments

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

waziqi89 avatar Mar 23 '23 16:03 waziqi89

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"]

waziqi89 avatar Mar 23 '23 16:03 waziqi89

reported to Lucene-core https://github.com/apache/lucene/issues/12221

waziqi89 avatar Apr 03 '23 17:04 waziqi89