Class SearchPlugin.SearchExtSpec<T extends SearchExtBuilder>

java.lang.Object
org.opensearch.plugins.SearchPlugin.SearchExtensionSpec<T,org.opensearch.common.CheckedFunction<org.opensearch.core.xcontent.XContentParser,T,IOException>>
org.opensearch.plugins.SearchPlugin.SearchExtSpec<T>
Enclosing interface:
SearchPlugin

public static class SearchPlugin.SearchExtSpec<T extends SearchExtBuilder> extends SearchPlugin.SearchExtensionSpec<T,org.opensearch.common.CheckedFunction<org.opensearch.core.xcontent.XContentParser,T,IOException>>
Specification for a SearchExtBuilder which represents an additional section that can be parsed in a search request (within the ext element).
  • Constructor Details

    • SearchExtSpec

      public SearchExtSpec(org.opensearch.core.ParseField name, org.opensearch.core.common.io.stream.Writeable.Reader<? extends T> reader, org.opensearch.common.CheckedFunction<org.opensearch.core.xcontent.XContentParser,T,IOException> parser)
      Specification of custom SearchExtBuilder.
      Parameters:
      name - holds the names by which this search ext might be parsed. The ParseField.getPreferredName() is special as it is the name by under which the reader is registered. So it is the name that the search ext should use as its NamedWriteable.getWriteableName() too. It is an error if ParseField.getPreferredName() conflicts with another registered name, including names from other plugins.
      reader - the reader registered for this search ext's builder. Typically, a reference to a constructor that takes a StreamInput
      parser - the parser function that reads the search ext builder from xcontent
    • SearchExtSpec

      public SearchExtSpec(String name, org.opensearch.core.common.io.stream.Writeable.Reader<? extends T> reader, org.opensearch.common.CheckedFunction<org.opensearch.core.xcontent.XContentParser,T,IOException> parser)
      Specification of custom SearchExtBuilder.
      Parameters:
      name - the name by which this search ext might be parsed or deserialized. Make sure that the search ext builder returns this name for NamedWriteable.getWriteableName(). It is an error if this name conflicts with another registered name, including names from other plugins.
      reader - the reader registered for this search ext's builder. Typically, a reference to a constructor that takes a StreamInput
      parser - the parser function that reads the search ext builder from xcontent