Package org.elasticsearch.plugins
Class SearchPlugin.SuggesterSpec<T extends SuggestionBuilder<T>>
java.lang.Object
org.elasticsearch.plugins.SearchPlugin.SearchExtensionSpec<T,org.elasticsearch.core.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,T,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.core.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,T,IOException>>
Specification for a
Suggester
.-
Constructor Summary
ConstructorDescriptionSuggesterSpec(String name, Writeable.Reader<T> builderReader, org.elasticsearch.core.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,T,IOException> builderParser, Writeable.Reader<? extends Suggest.Suggestion> suggestionReader)
Specification of customSuggester
.SuggesterSpec(org.elasticsearch.common.xcontent.ParseField name, Writeable.Reader<T> builderReader, org.elasticsearch.core.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,T,IOException> builderParser, Writeable.Reader<? extends Suggest.Suggestion> suggestionReader)
Specification of customSuggester
. -
Method Summary
Modifier and TypeMethodDescriptionWriteable.Reader<? extends Suggest.Suggestion>
Returns the reader used to read theSuggest.Suggestion
generated by this suggesterMethods inherited from class org.elasticsearch.plugins.SearchPlugin.SearchExtensionSpec
getName, getParser, getReader
-
Constructor Details
-
SuggesterSpec
public SuggesterSpec(org.elasticsearch.common.xcontent.ParseField name, Writeable.Reader<T> builderReader, org.elasticsearch.core.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,T,IOException> builderParser, Writeable.Reader<? extends Suggest.Suggestion> suggestionReader)Specification of customSuggester
.- Parameters:
name
- holds the names by which this suggester might be parsed. TheParseField.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 theirNamedWriteable.getWriteableName()
return values too.builderReader
- the reader registered for this suggester's builder. Typically a reference to a constructor that takes aStreamInput
builderParser
- a parser that reads the suggester's builder from xcontentsuggestionReader
- the reader registered for this suggester's Suggestion response. Typically a reference to a constructor that takes aStreamInput
-
SuggesterSpec
public SuggesterSpec(String name, Writeable.Reader<T> builderReader, org.elasticsearch.core.CheckedFunction<org.elasticsearch.common.xcontent.XContentParser,T,IOException> builderParser, Writeable.Reader<? extends Suggest.Suggestion> suggestionReader)Specification of customSuggester
.- 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 forNamedWriteable.getWriteableName()
.builderReader
- the reader registered for this suggester's builder. Typically a reference to a constructor that takes aStreamInput
builderParser
- a parser that reads the suggester's builder from xcontentsuggestionReader
- the reader registered for this suggester's Suggestion response. Typically a reference to a constructor that takes aStreamInput
-
-
Method Details
-
getSuggestionReader
Returns the reader used to read theSuggest.Suggestion
generated by this suggester
-