waziqi89 opened a new issue, #12221: URL: https://github.com/apache/lucene/issues/12221
### Description This is an issue found in BaseFragmentsBuilder. It makes FVH could potentially append the first word from the next field under a multiValue field to the fragment. To reproduce it: 1. We need to use FVH to highlight a multiValue field 2. We need to use ScoreFragListBuilder allow the fragment building order is not the indexing order 3. We need to have a document whose best matched fragments is not from the first indexed field 4. We need the fragment size large enough, so the fragment's end offset could be larger than the field end offset 5. We need to fetch not only the top fragments (i.e. maxNumFragments > 1 ) 6. FVH fetches the fragments from the fields which are indexed before the best matched field To make it easier to understand, I created a branch with a [test case](https://github.com/apache/lucene/commit/70aaf684196605c0eef315766383cd8f29d9848f#diff-6e5c26b879d097826a8739ee7ca1efaa4b908d12a5a5d6a8c9fc0c5f146573e9R68). Note that The last word "Second" comes from a different field. ### Version and environment details _No response_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org