Hello.
I'm trying to set the Highlighting encoder
option to "html"
instead of leaving the default for a specific field, and the Java API apparently has no way to do that (although the ElasticSearch reference documentation says we can override all highlighting settings for each field).
HighlightBuilder
and HighlightBuilder.Field
both extend AbstractHighlighterBuilder
. HighlightBuilder has an encoder(String)
method, but HighlighBuilder.Field
doesn't.
This is not only annoying, but also a security issue since using the default strategy opens the door to HTML injection.
Also, BTW, the javadoc of HighlightBuilder.encoder()
says that the two allowed values are "styled" and "default", but the reference documentation says the possible values are "html" and "default".
Is there something I'm missing, or is it indeed a missing method in the API?