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 String |
TYPE |
EMPTY_CONFIG, EMPTY_CONTEXT, EMPTY_MAPPING, FIELD_MISSING, FIELD_TYPE, FIELD_VALUE, name, SEPARATOR, typeEMPTY_PARAMS| Constructor and Description |
|---|
CategoryContextMapping(String name)
Create a new
CategoryContextMapping with the default field
[_type] |
CategoryContextMapping(String name,
Iterable<? extends CharSequence> defaultValues)
Create a new
CategoryContextMapping with the default field
[_type] |
CategoryContextMapping(String name,
String fieldName)
Create a new
CategoryContextMapping with the default field
[_type] |
CategoryContextMapping(String name,
String fieldName,
Iterable<? extends CharSequence> defaultValues)
Create a new
CategoryContextMapping with the default field
[_type] |
| Modifier and Type | Method and Description |
|---|---|
org.elasticsearch.search.suggest.context.CategoryContextMapping.FieldConfig |
defaultConfig() |
boolean |
equals(Object obj) |
Iterable<? extends CharSequence> |
getDefaultValues() |
String |
getFieldName()
Name of the field used by this
CategoryContextMapping |
int |
hashCode() |
protected static CategoryContextMapping |
load(String name,
Map<String,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.context.CategoryContextMapping.FieldQuery |
parseQuery(String name,
XContentParser parser)
Parse a query according to the context.
|
static org.elasticsearch.search.suggest.context.CategoryContextMapping.FieldQuery |
query(String name,
CharSequence... fieldvalues) |
static org.elasticsearch.search.suggest.context.CategoryContextMapping.FieldQuery |
query(String name,
Iterable<? extends 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, typeprotected static final String TYPE
public CategoryContextMapping(String name)
CategoryContextMapping with the default field
[_type]public CategoryContextMapping(String name, String fieldName)
CategoryContextMapping with the default field
[_type]public CategoryContextMapping(String name, Iterable<? extends CharSequence> defaultValues)
CategoryContextMapping with the default field
[_type]public CategoryContextMapping(String name, String fieldName, Iterable<? extends CharSequence> defaultValues)
CategoryContextMapping with the default field
[_type]public String getFieldName()
CategoryContextMappingpublic Iterable<? extends CharSequence> getDefaultValues()
public org.elasticsearch.search.suggest.context.CategoryContextMapping.FieldConfig defaultConfig()
defaultConfig in class ContextMappingprotected static CategoryContextMapping load(String name, Map<String,Object> config) throws ElasticsearchParseException
CategoryContextMappingfield - name of the field to use. If null default field
will be usedCategoryContextMappingElasticsearchParseExceptionprotected XContentBuilder toInnerXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
ContextMappingtoInnerXContent in class ContextMappingbuilder - builder to append the mapping toparams - parameters passed to the builderIOExceptionpublic ContextMapping.ContextConfig parseContext(ParseContext parseContext, XContentParser parser) throws 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 mappingIOExceptionElasticsearchParseExceptionpublic org.elasticsearch.search.suggest.context.CategoryContextMapping.FieldQuery parseQuery(String name, XContentParser parser) throws IOException, ElasticsearchParseException
ContextMappingparseQuery in class ContextMappingname - name of the contextparser - XContentParser providing the data of the queryContextMapping.ContextQuery according to this mappingIOExceptionElasticsearchParseExceptionpublic static org.elasticsearch.search.suggest.context.CategoryContextMapping.FieldQuery query(String name, CharSequence... fieldvalues)
public static org.elasticsearch.search.suggest.context.CategoryContextMapping.FieldQuery query(String name, Iterable<? extends CharSequence> fieldvalues)
Copyright © 2009–2017. All rights reserved.