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
Highlight fields in request order #6178
Conversation
This doesn't actually implement conditional highlighting but it gives plugins the one tool that they need to implement it themselves: guaranteed execution order. Without it the fields are highlighted in hashmap iteration order which means the plugin can't push data from one field to the next reliably. |
* Use a syntax that is explicit about the order in which fields should be highlighted. | ||
* @return this for chaining | ||
*/ | ||
public SearchRequestBuilder setHighlighterExplicitFieldOrderSyntax(boolean explicitFieldOrderSyntax) { |
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.
Or maybe just setHighlighterExplicitFieldOrder
?
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.
Yeah, adding syntax is a bit pedantic, right? I'll change it. As a side note, even without the explicit field order syntax they'll still be executed in the order that they appear in the document. It just didn't feel with it to randomize the order if the syntax wasn't used.
@nik9000 I left a minor comment about the name of the parameter that allows to make the field order explicit but other than that this looks good to me! |
Done! |
Sorry, not quite done. On more moment. |
Because json objects are unordered this also adds an explicit order syntax that looks like "highlight": { "fields": [ {"title":{ /*params*/ }}, {"text":{ /*params*/ }} ] } This is not useful for any of the builtin highlighters but will be useful in plugins. Closes elastic#4649
Done. |
Merged. Thanks, Nik! |
Because json objects are unordered this also adds an explicit order syntax
that looks like
This is not useful for any of the builtin highlighters but will be useful
in plugins.
Closes #4649