-
Notifications
You must be signed in to change notification settings - Fork 25.2k
Add a new highlighter based on lucene's match highlighter #92068
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
base: main
Are you sure you want to change the base?
Conversation
Pinging @elastic/es-search (Team:Search) |
Hi @romseygeek, I've created a changelog YAML for you. |
@@ -106,7 +107,7 @@ | |||
|
|||
public class HighlighterSearchIT extends ESIntegTestCase { | |||
// TODO as we move analyzers out of the core we need to move some of these into HighlighterWithAnalyzersTests | |||
private static final String[] ALL_TYPES = new String[] { "plain", "fvh", "unified" }; | |||
private static final String[] ALL_TYPES = new String[] { "plain", "fvh", "unified", "matches" }; | |||
|
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.
At some point we should rewrite at least some of this as an abstract highlighter test case which each highlighter implementation can then test itself against.
@@ -3508,6 +3509,9 @@ public void testWithNestedQuery() throws Exception { | |||
// but we highlight the root text field since nested documents cannot be highlighted with postings nor term vectors | |||
// directly. | |||
for (String type : ALL_TYPES) { | |||
if (Objects.equals("matches", type)) { | |||
continue; // matches highlighter doesn't support nested fields | |||
} |
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.
... yet
Note that the majority of the lines in this PR are copies of Apache Lucene classes that will be removed after the next lucene release, as they contain usability fixes I discovered while working on this project. |
…r' into highlight/matches-highlighter
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
This is considerably simpler and more accurate than our existing highlighters,
and should cover the vast majority of required functionality.
Still to do:
I'd like to go through the
:Search/Highlighting
label and see if any of the reported bugs there become easier to fix with this implementation.