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 Details

    • ScoreFunctionSpec

      public ScoreFunctionSpec(org.opensearch.common.ParseField name, Writeable.Reader<T> reader, ScoreFunctionParser<T> parser)
      Specification of custom ScoreFunctionBuilder.
      Parameters:
      name - holds the names by which this score function 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 score function 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 score function's builder. Typically, a reference to a constructor that takes a StreamInput
      parser - the parser the reads the score function builder from xcontent
    • ScoreFunctionSpec

      public ScoreFunctionSpec(String name, Writeable.Reader<T> reader, ScoreFunctionParser<T> parser)
      Specification of custom ScoreFunctionBuilder.
      Parameters:
      name - the name by which this score function might be parsed or deserialized. Make sure that the score function 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 score function's builder. Typically, a reference to a constructor that takes a StreamInput
      parser - the parser the reads the score function builder from xcontent