public abstract static class ContextMapping.ContextQuery extends Object implements ToXContent
ContextMapping.ContextQuery
defines the context information for a specific ContextMapping
defined within a suggestion request. According to the parameters set in the request and the
ContextMapping
such a query is used to wrap the TokenStream
of the actual
suggestion request into a TokenStream
with the context settingsToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
Modifier and Type | Field and Description |
---|---|
protected String |
name |
EMPTY_PARAMS
Modifier | Constructor and Description |
---|---|
protected |
ContextMapping.ContextQuery(String name) |
Modifier and Type | Method and Description |
---|---|
String |
name() |
static List<ContextMapping.ContextQuery> |
parseQueries(Map<String,ContextMapping> mappings,
XContentParser parser)
Parse a set of
ContextMapping.ContextQuery according to a given mapping |
protected abstract org.apache.lucene.util.automaton.Automaton |
toAutomaton()
Build a LookUp Automaton for this context.
|
static org.apache.lucene.util.automaton.Automaton |
toAutomaton(boolean preserveSep,
Iterable<ContextMapping.ContextQuery> queries)
Create a automaton for a given context query this automaton will be used
to find the matching paths with the fst
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
toXContent
protected final String name
protected ContextMapping.ContextQuery(String name)
public String name()
public static org.apache.lucene.util.automaton.Automaton toAutomaton(boolean preserveSep, Iterable<ContextMapping.ContextQuery> queries)
preserveSep
- set an additional char (XAnalyzingSuggester.SEP_LABEL
) between each context queryqueries
- list of ContextMapping.ContextQuery
defining the lookup contextprotected abstract org.apache.lucene.util.automaton.Automaton toAutomaton()
public static List<ContextMapping.ContextQuery> parseQueries(Map<String,ContextMapping> mappings, XContentParser parser) throws IOException, ElasticsearchParseException
ContextMapping.ContextQuery
according to a given mappingmappings
- List of mapping defined y the suggest fieldparser
- parser holding the settings of the queries. The parsers
current token is assumed hold an array. The number of elements
in this array must match the number of elements in the mappings.IOException
- if something unexpected happened on the underlying streamElasticsearchParseException
- if the list of queries could not be parsedCopyright © 2009–2016. All rights reserved.