Closed
Description
The RestHighLevelClient allows for custom options for a highlighted field. In DSL:
"highlight": {
"type": "my-custom-highlighter",
"highlight_query": {[..]}
"order": "score",
"fields": {
"my-field": {
"options": {
"foo": "bar"
}
}
}
}
In Java with RHLC that can be done with:
final HighlightBuilder.Field highlightField = new HighlightBuilder.Field("my-field")
.options(Map.of("foo", "bar"));
However, no such support for custom options exist in new Java client. Any plans to re-introduce that functionality?
Implementation in RHLC can be found in org/elasticsearch/search/fetch/subphase/highlight/AbstractHighlighterBuilder.java
:
[..]
/**
* Allows to set custom options for custom highlighters.
*/
@SuppressWarnings("unchecked")
public HB options(Map<String, Object> options) {
this.options = options;
return (HB) this;
}
[..]