Class SearchPlugin.SearchExtensionSpec<W extends NamedWriteable,​P>

java.lang.Object
org.elasticsearch.plugins.SearchPlugin.SearchExtensionSpec<W,​P>
Type Parameters:
W - the type of the main NamedWriteable for this spec. All specs have this but it isn't always *for* the same thing though, usually it is some sort of builder sent from the coordinating node to the data nodes executing the behavior
P - the type of the parser for this spec. The parser runs on the coordinating node, converting XContent into the behavior to execute
Direct Known Subclasses:
SearchPlugin.AggregationSpec, SearchPlugin.PipelineAggregationSpec, SearchPlugin.QuerySpec, SearchPlugin.RescorerSpec, SearchPlugin.ScoreFunctionSpec, SearchPlugin.SearchExtSpec, SearchPlugin.SignificanceHeuristicSpec, SearchPlugin.SuggesterSpec
Enclosing interface:
SearchPlugin

public static class SearchPlugin.SearchExtensionSpec<W extends NamedWriteable,​P> extends Object
Specification of search time behavior extension like a custom MovAvgModel or ScoreFunction.
  • Constructor Details

    • SearchExtensionSpec

      public SearchExtensionSpec(org.elasticsearch.common.xcontent.ParseField name, Writeable.Reader<? extends W> reader, P parser)
      Build the spec with a ParseField.
      Parameters:
      name - the name of the behavior as a ParseField. The parser is registered under all names specified by the ParseField but the reader is only registered under the ParseField.getPreferredName() so be sure that that is the name that W's NamedWriteable.getWriteableName() returns.
      reader - reader that reads the behavior from the internode protocol
      parser - parser that read the behavior from a REST request
    • SearchExtensionSpec

      public SearchExtensionSpec(String name, Writeable.Reader<? extends W> reader, P parser)
      Build the spec with a String.
      Parameters:
      name - the name of the behavior. The parser and the reader are are registered under this name so be sure that that is the name that W's NamedWriteable.getWriteableName() returns.
      reader - reader that reads the behavior from the internode protocol
      parser - parser that read the behavior from a REST request
  • Method Details

    • getName

      public org.elasticsearch.common.xcontent.ParseField getName()
      The name of the thing being specified as a ParseField. This allows it to have deprecated names.
    • getReader

      public Writeable.Reader<? extends W> getReader()
      The reader responsible for reading the behavior from the internode protocol.
    • getParser

      public P getParser()
      The parser responsible for converting XContent into the behavior.