Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a bug in fhv: first word from next field is appended in multiValue fields #567

Open
waziqi89 opened this issue Apr 3, 2023 · 1 comment
Assignees

Comments

@waziqi89
Copy link
Contributor

waziqi89 commented Apr 3, 2023

This happens when fetch fragments using NRTFastVectorHighLighter(fhv).
To reproduce this:

using fhv to highlight a multivalue field
the fragment is at the end of the field
the fragment is from a non-top-matched field
the non-top-matched field is stored in front of the top-matched field

This is a bug from lucene-core, and not fixed in the latest version. (no one reports it)

The bug is caused by the BaseFragmentBuilder.
When processing a multivalue field with the discreteMultiValue toggle on (do not create fragments across the field), the discreteMultiValueHighlighting will be called to reprocess the fragInfos with respect to the multivalue field.
However, when creating the new fragInfos, it doesn't subtract 1 from fragEnd, ending up the fragment actually ends at the first char from the next field.
later on, when creating the fragment string, a boundary scanner will be used to avoid chopping the word at the end of the fragment, so it will continue expanding the end till the end of first word from the next field.

This isn't a concern for the top field, because it is always processed first, plus a coincident of a buffer design and a out-of-boundary fallback mechanism.

@waziqi89 waziqi89 self-assigned this Apr 3, 2023
@waziqi89
Copy link
Contributor Author

waziqi89 commented Apr 3, 2023

created a fix PR in Lucene-core
apache/lucene#12221

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant