public static class SearchPlugin.QuerySpec<T extends QueryBuilder> extends SearchPlugin.SearchExtensionSpec<T,QueryParser<T>>
Query
.Constructor and Description |
---|
QuerySpec(ParseField name,
Writeable.Reader<T> reader,
QueryParser<T> parser)
Specification of custom
Query . |
QuerySpec(java.lang.String name,
Writeable.Reader<T> reader,
QueryParser<T> parser)
Specification of custom
Query . |
getName, getParser, getReader
public QuerySpec(ParseField name, Writeable.Reader<T> reader, QueryParser<T> parser)
Query
.name
- holds the names by which this query 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 query's builder. Typically a reference to a constructor that takes a
StreamInput
parser
- the parser the reads the query builder from xcontentpublic QuerySpec(java.lang.String name, Writeable.Reader<T> reader, QueryParser<T> parser)
Query
.name
- the name by which this query might be parsed or deserialized. Make sure that the query builder returns this name for
NamedWriteable.getWriteableName()
.reader
- the reader registered for this query's builder. Typically a reference to a constructor that takes a
StreamInput
parser
- the parser the reads the query builder from xcontent