Skip to content

Missing support for custom options of custom highlighter #168

Closed
@leeuwr

Description

@leeuwr

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;
    }
[..]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions