public abstract static class ContextMapping.ContextQuery extends java.lang.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 java.lang.String |
name |
EMPTY_PARAMS| Modifier | Constructor and Description |
|---|---|
protected |
ContextQuery(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
name() |
static java.util.List<ContextMapping.ContextQuery> |
parseQueries(java.util.Map<java.lang.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,
java.lang.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
|
java.lang.String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisFragment, toXContentpublic java.lang.String name()
public static org.apache.lucene.util.automaton.Automaton toAutomaton(boolean preserveSep,
java.lang.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 java.util.List<ContextMapping.ContextQuery> parseQueries(java.util.Map<java.lang.String,ContextMapping> mappings, XContentParser parser) throws java.io.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.java.io.IOException - if something unexpected happened on the underlying streamElasticsearchParseException - if the list of queries could not be parsedpublic java.lang.String toString()
toString in class java.lang.Object