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

UnifiedHighlighter highlight on multiple fields (#13268) #13297

Conversation

mayya-sharipova
Copy link
Contributor

@mayya-sharipova mayya-sharipova commented Apr 12, 2024

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 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.
@mayya-sharipova mayya-sharipova force-pushed the unified-highlighter-multi-fields_9x branch from 8da4ac9 to 06e5e62 Compare April 12, 2024 14:44
@mayya-sharipova mayya-sharipova merged commit b727f0d into apache:branch_9x Apr 12, 2024
2 checks passed
@mayya-sharipova mayya-sharipova deleted the unified-highlighter-multi-fields_9x branch April 12, 2024 15:30
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

Successfully merging this pull request may close these issues.

None yet

1 participant