-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
UnifiedHighlighter highlight on multiple fields #13268
UnifiedHighlighter highlight on multiple fields #13268
Conversation
0f00284
to
147b57e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great addition @mayya-sharipova .
I left a comment regarding the exposure, we should also document the limit of the feature (input should be identical for all masked fields).
lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/UnifiedHighlighter.java
Outdated
Show resolved
Hide resolved
Add ability to UnifiedHighlighter to combine matches from multiple fields to highlight a single field. FastVectorHighlighter for a long time has an option to highlight a single field based on matches from several fields. But UnifiedHighlighter was missing this option. This adds this ability.
147b57e
to
30a63b0
Compare
@jimczi Thanks for your initial review. I've tried to address all your comments, so this is ready for another review. |
lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/UnifiedHighlighter.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Add ability to UnifiedHighlighter to combine matches from multiple fields to highlight a single field. FastVectorHighlighter for a long time has an option to highlight a single field based on matches from several fields. But UnifiedHighlighter was missing this option. This adds this ability with a new function: `UnifiedHighlighter::withMaskedFieldsFunc` that sets up a function that given a field retuns a set of masked fields whose matches are combined to highlight the given field.
Add ability to UnifiedHighlighter to combine matches from multiple fields to highlight a single field. FastVectorHighlighter for a long time has an option to highlight a single field based on matches from several fields. But UnifiedHighlighter was missing this option. This adds this ability with a new function: `UnifiedHighlighter::withMaskedFieldsFunc` that sets up a function that given a field retuns a set of masked fields whose matches are combined to highlight the given field.
Add ability to UnifiedHighlighter to combine matches from multiple fields to highlight a single field. FastVectorHighlighter for a long time has an option to highlight a single field based on matches from several fields. But UnifiedHighlighter was missing this option. This adds this ability with a new function: `UnifiedHighlighter::withMaskedFieldsFunc` that sets up a function that given a field retuns a set of masked fields whose matches are combined to highlight the given field. Backport for PR #13268
Add support to the Uunified highlighter to combine matches on multiple fields to highlight a single field: "matched_fields". Based on Lucene PR: apache/lucene#13268 Lucene PR is based on the concept of masked fields where masked fields are different from the original highlighted field. This PR in Elasticsearch uses the already existing highlighter parameter "matched_fields" Closes elastic#5172
Add support to the Unified highlighter to combine matches on multiple fields to highlight a single field: "matched_fields". Based on Lucene PR: apache/lucene#13268 Lucene PR is based on the concept of masked fields where masked fields are different from the original highlighted field. This PR in Elasticsearch uses the already existing highlighter parameter "matched_fields".
Add ability to UnifiedHighlighter to combine matches from multiple fields
to highlight a single field.
FastVectorHighlighter for a long time has an option to highlight a single field
based on matches from several fields. But UnifiedHighlighter was missing this option.
This adds this ability.