Class SearchPlugin.SuggesterSpec<T extends SuggestionBuilder<T>>

java.lang.Object
org.elasticsearch.plugins.SearchPlugin.SearchExtensionSpec<T,​org.elasticsearch.common.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,​T,​java.io.IOException>>
org.elasticsearch.plugins.SearchPlugin.SuggesterSpec<T>
Enclosing interface:
SearchPlugin

public static class SearchPlugin.SuggesterSpec<T extends SuggestionBuilder<T>>
extends SearchPlugin.SearchExtensionSpec<T,​org.elasticsearch.common.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,​T,​java.io.IOException>>
Specification for a Suggester.
  • Constructor Details

    • SuggesterSpec

      public SuggesterSpec​(org.elasticsearch.common.ParseField name, Writeable.Reader<T> builderReader, org.elasticsearch.common.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,​T,​java.io.IOException> builderParser, Writeable.Reader<? extends Suggest.Suggestion> suggestionReader)
      Specification of custom Suggester.
      Parameters:
      name - holds the names by which this suggester might be parsed. The ParseField.getPreferredName() is special as it is the name by under which the request builder and Suggestion response readers are registered. So it is the name that the query and Suggestion response should use as their NamedWriteable.getWriteableName() return values too.
      builderReader - the reader registered for this suggester's builder. Typically a reference to a constructor that takes a StreamInput
      builderParser - a parser that reads the suggester's builder from xcontent
      suggestionReader - the reader registered for this suggester's Suggestion response. Typically a reference to a constructor that takes a StreamInput
    • SuggesterSpec

      public SuggesterSpec​(java.lang.String name, Writeable.Reader<T> builderReader, org.elasticsearch.common.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,​T,​java.io.IOException> builderParser, Writeable.Reader<? extends Suggest.Suggestion> suggestionReader)
      Specification of custom Suggester.
      Parameters:
      name - the name by which this suggester might be parsed or deserialized. Make sure that the query builder and Suggestion response reader return this name for NamedWriteable.getWriteableName().
      builderReader - the reader registered for this suggester's builder. Typically a reference to a constructor that takes a StreamInput
      builderParser - a parser that reads the suggester's builder from xcontent
      suggestionReader - the reader registered for this suggester's Suggestion response. Typically a reference to a constructor that takes a StreamInput
  • Method Details