public static class SearchPlugin.SuggesterSpec<T extends SuggestionBuilder<T>> extends SearchPlugin.SearchExtensionSpec<T,CheckedFunction<XContentParser,T,java.io.IOException>>
Suggester
.Constructor and Description |
---|
SuggesterSpec(ParseField name,
Writeable.Reader<T> reader,
CheckedFunction<XContentParser,T,java.io.IOException> parser)
Specification of custom
Suggester . |
SuggesterSpec(java.lang.String name,
Writeable.Reader<T> reader,
CheckedFunction<XContentParser,T,java.io.IOException> parser)
Specification of custom
Suggester . |
getName, getParser, getReader
public SuggesterSpec(ParseField name, Writeable.Reader<T> reader, CheckedFunction<XContentParser,T,java.io.IOException> parser)
Suggester
.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 reader is registered. So it is the name that the query should use as its
NamedWriteable.getWriteableName()
too.reader
- the reader registered for this suggester's builder. Typically a reference to a constructor that takes a
StreamInput
parser
- the parser the reads the query suggester from xcontentpublic SuggesterSpec(java.lang.String name, Writeable.Reader<T> reader, CheckedFunction<XContentParser,T,java.io.IOException> parser)
Suggester
.name
- the name by which this suggester might be parsed or deserialized. Make sure that the query builder returns this name
for NamedWriteable.getWriteableName()
.reader
- the reader registered for this suggester's builder. Typically a reference to a constructor that takes a
StreamInput
parser
- the parser the reads the suggester builder from xcontent