Package org.opensearch.plugins
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 Summary
ConstructorDescriptionSearchExtSpec
(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 customSearchExtBuilder
.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 customSearchExtBuilder
. -
Method Summary
Methods inherited from class org.opensearch.plugins.SearchPlugin.SearchExtensionSpec
getName, getParser, getReader
-
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 customSearchExtBuilder
.- Parameters:
name
- holds the names by which this search ext might be parsed. TheParseField.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 itsNamedWriteable.getWriteableName()
too. It is an error ifParseField.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 aStreamInput
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 customSearchExtBuilder
.- Parameters:
name
- the name by which this search ext might be parsed or deserialized. Make sure that the search ext builder returns this name forNamedWriteable.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 aStreamInput
parser
- the parser function that reads the search ext builder from xcontent
-