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

Unified Highlighter to support matched_fields #107640

Conversation

mayya-sharipova
Copy link
Contributor

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 #5172

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
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Apr 18, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@mayya-sharipova
Copy link
Contributor Author

@jimczi What do you think of reusing the already existing parameter of matched_fields?
I have not updated the documentation in this PR as I want to confirm this first.

@jimczi
Copy link
Contributor

jimczi commented Apr 18, 2024

+1 to reuse matched_fields

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, should we also throw an error if requireFieldMatch is false?

@mayya-sharipova
Copy link
Contributor Author

mayya-sharipova commented Apr 29, 2024

@jimczi @benwtrent Thanks for your feedback. I've addressed your comments. This is ready for another set of reviews.

@mayya-sharipova
Copy link
Contributor Author

@jimczi Thanks for the feedback so far, I am wondering if you have any additional comments

Copy link
Contributor

@jimczi jimczi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jimczi
Copy link
Contributor

jimczi commented May 7, 2024

Please add an entry to the change log too

@benwtrent
Copy link
Member

@mayya-sharipova yes, please manually add a PR changes entry. This way we can keep track of features added when the Lucene snapshot branch is merged into main.

@mayya-sharipova
Copy link
Contributor Author

@elasticsearchmachine run elasticsearch-ci/part-1

@mayya-sharipova mayya-sharipova merged commit 2337eb0 into elastic:lucene_snapshot May 9, 2024
15 checks passed
@mayya-sharipova mayya-sharipova deleted the uhighlighter-multiple-fields branch May 9, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :Search/Highlighting How a query matched a document Team:Search Meta label for search team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants