Package org.opensearch.plugins
Class SearchPlugin.ScoreFunctionSpec<T extends ScoreFunctionBuilder<T>>
java.lang.Object
org.opensearch.plugins.SearchPlugin.SearchExtensionSpec<T,ScoreFunctionParser<T>>
org.opensearch.plugins.SearchPlugin.ScoreFunctionSpec<T>
- Enclosing interface:
- SearchPlugin
public static class SearchPlugin.ScoreFunctionSpec<T extends ScoreFunctionBuilder<T>>
extends SearchPlugin.SearchExtensionSpec<T,ScoreFunctionParser<T>>
Specification of custom
ScoreFunction
.-
Constructor Summary
ConstructorsConstructorDescriptionScoreFunctionSpec
(String name, Writeable.Reader<T> reader, ScoreFunctionParser<T> parser) Specification of customScoreFunctionBuilder
.ScoreFunctionSpec
(org.opensearch.common.ParseField name, Writeable.Reader<T> reader, ScoreFunctionParser<T> parser) Specification of customScoreFunctionBuilder
. -
Method Summary
Methods inherited from class org.opensearch.plugins.SearchPlugin.SearchExtensionSpec
getName, getParser, getReader
-
Constructor Details
-
ScoreFunctionSpec
public ScoreFunctionSpec(org.opensearch.common.ParseField name, Writeable.Reader<T> reader, ScoreFunctionParser<T> parser) Specification of customScoreFunctionBuilder
.- Parameters:
name
- holds the names by which this score function 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 score function 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 score function's builder. Typically, a reference to a constructor that takes aStreamInput
parser
- the parser the reads the score function builder from xcontent
-
ScoreFunctionSpec
Specification of customScoreFunctionBuilder
.- Parameters:
name
- the name by which this score function might be parsed or deserialized. Make sure that the score function 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 score function's builder. Typically, a reference to a constructor that takes aStreamInput
parser
- the parser the reads the score function builder from xcontent
-