waziqi89 commented on issue #12221:
URL: https://github.com/apache/lucene/issues/12221#issuecomment-1494557233

   The root cause is it is that, while creating the `WeightedFragInfo` in 
[discreteMultiValueHighlighting](https://github.com/apache/lucene/blob/main/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java#L372),
 the `FragEnd` is the first char after the fragment, so we need to use `FragEnd 
- 1` instead.
   This is not a problem when fetching one field only because of a [safeguard 
mechanism](https://github.com/apache/lucene/blob/main/lucene/highlighter/src/java/org/apache/lucene/search/vectorhighlight/BaseFragmentsBuilder.java#L254)
 in buffer to avoid go beyond the buffer size, and the buffer starts build 
until the field which contains the best match ends when creating the first 
fragment.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to