public class CategoryContextMapping extends ContextMapping
CategoryContextMapping is used to define a ContextMapping that
references a field within a document. The value of the field in turn will be
used to setup the suggestions made by the completion suggester.| Modifier and Type | Class and Description |
|---|---|
static class |
CategoryContextMapping.Builder |
ContextMapping.Context, ContextMapping.ContextConfig, ContextMapping.ContextQueryToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
TYPE |
EMPTY_CONFIG, EMPTY_CONTEXT, EMPTY_MAPPING, FIELD_MISSING, FIELD_TYPE, FIELD_VALUE, name, SEPARATOR, typeEMPTY_PARAMS| Constructor and Description |
|---|
CategoryContextMapping(java.lang.String name)
Create a new
CategoryContextMapping with the default field
[_type] |
CategoryContextMapping(java.lang.String name,
java.lang.Iterable<java.lang.String> defaultValues)
Create a new
CategoryContextMapping with the default field
[_type] |
CategoryContextMapping(java.lang.String name,
java.lang.String fieldName)
Create a new
CategoryContextMapping with the default field
[_type] |
CategoryContextMapping(java.lang.String name,
java.lang.String fieldName,
java.lang.Iterable<java.lang.String> defaultValues)
Create a new
CategoryContextMapping with the default field
[_type] |
| Modifier and Type | Method and Description |
|---|---|
org.elasticsearch.search.suggest.completion2x.context.CategoryContextMapping.FieldConfig |
defaultConfig() |
boolean |
equals(java.lang.Object obj) |
java.lang.Iterable<? extends java.lang.CharSequence> |
getDefaultValues() |
java.lang.String |
getFieldName()
Name of the field used by this
CategoryContextMapping |
int |
hashCode() |
protected static CategoryContextMapping |
load(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> config)
Load the specification of a
CategoryContextMapping |
ContextMapping.ContextConfig |
parseContext(ParseContext parseContext,
XContentParser parser)
A
ContextMapping combined with the information provided by a document
form a ContextMapping.ContextConfig which is used to build the underlying FST. |
org.elasticsearch.search.suggest.completion2x.context.CategoryContextMapping.FieldQuery |
parseQuery(java.lang.String name,
XContentParser parser)
Parse a query according to the context.
|
static org.elasticsearch.search.suggest.completion2x.context.CategoryContextMapping.FieldQuery |
query(java.lang.String name,
java.lang.CharSequence... fieldvalues) |
static org.elasticsearch.search.suggest.completion2x.context.CategoryContextMapping.FieldQuery |
query(java.lang.String name,
java.lang.Iterable<? extends java.lang.CharSequence> fieldvalues) |
protected XContentBuilder |
toInnerXContent(XContentBuilder builder,
ToXContent.Params params)
Since every context mapping is assumed to have a name given by the field name of an context object, this
method is used to build the value used to serialize the mapping
|
mappingsAreEqual, name, toString, toXContent, typeclone, finalize, getClass, notify, notifyAll, wait, wait, waitisFragmentprotected static final java.lang.String TYPE
public CategoryContextMapping(java.lang.String name)
CategoryContextMapping with the default field
[_type]public CategoryContextMapping(java.lang.String name,
java.lang.String fieldName)
CategoryContextMapping with the default field
[_type]public CategoryContextMapping(java.lang.String name,
java.lang.Iterable<java.lang.String> defaultValues)
CategoryContextMapping with the default field
[_type]public CategoryContextMapping(java.lang.String name,
java.lang.String fieldName,
java.lang.Iterable<java.lang.String> defaultValues)
CategoryContextMapping with the default field
[_type]public java.lang.String getFieldName()
CategoryContextMappingpublic java.lang.Iterable<? extends java.lang.CharSequence> getDefaultValues()
public org.elasticsearch.search.suggest.completion2x.context.CategoryContextMapping.FieldConfig defaultConfig()
defaultConfig in class ContextMappingprotected static CategoryContextMapping load(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> config) throws ElasticsearchParseException
CategoryContextMappingname - name of the field to use. If null default field
will be usedCategoryContextMappingElasticsearchParseExceptionprotected XContentBuilder toInnerXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
ContextMappingtoInnerXContent in class ContextMappingbuilder - builder to append the mapping toparams - parameters passed to the builderjava.io.IOExceptionpublic ContextMapping.ContextConfig parseContext(ParseContext parseContext, XContentParser parser) throws java.io.IOException, ElasticsearchParseException
ContextMappingContextMapping combined with the information provided by a document
form a ContextMapping.ContextConfig which is used to build the underlying FST.parseContext in class ContextMappingparseContext - context of parsing phaseparser - XContentParser used to read and setup the configurationContextMapping.ContextConfig related to this mappingjava.io.IOExceptionElasticsearchParseExceptionpublic org.elasticsearch.search.suggest.completion2x.context.CategoryContextMapping.FieldQuery parseQuery(java.lang.String name,
XContentParser parser)
throws java.io.IOException,
ElasticsearchParseException
ContextMappingparseQuery in class ContextMappingname - name of the contextparser - XContentParser providing the data of the queryContextMapping.ContextQuery according to this mappingjava.io.IOExceptionElasticsearchParseExceptionpublic static org.elasticsearch.search.suggest.completion2x.context.CategoryContextMapping.FieldQuery query(java.lang.String name,
java.lang.CharSequence... fieldvalues)
public static org.elasticsearch.search.suggest.completion2x.context.CategoryContextMapping.FieldQuery query(java.lang.String name,
java.lang.Iterable<? extends java.lang.CharSequence> fieldvalues)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Object