public class CompletionFieldMapper extends FieldMapper implements ArrayValueMapperParser
ContextMappings.load(Object, Version) for CONTEXTSparse(ParseContext) for acceptable inputs for indexing
This field type constructs completion queries that are run
against the weighted FST index by the CompletionSuggester.
This field can also be extended to add search criteria to suggestions
for query-time filtering and boosting (see ContextMappings
| Modifier and Type | Class and Description |
|---|---|
static class |
CompletionFieldMapper.Builder
Builder for
CompletionFieldMapper |
static class |
CompletionFieldMapper.CompletionFieldType |
static class |
CompletionFieldMapper.Defaults |
static class |
CompletionFieldMapper.Fields |
static class |
CompletionFieldMapper.TypeParser |
FieldMapper.CopyTo, FieldMapper.MultiFieldsMapper.BuilderContextToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params| Modifier and Type | Field and Description |
|---|---|
static java.util.Set<java.lang.String> |
ALLOWED_CONTENT_FIELD_NAMES |
static java.lang.String |
CONTENT_TYPE |
COERCE_SETTING, copyTo, defaultFieldType, fieldType, IGNORE_MALFORMED_SETTING, multiFieldsEMPTY_PARAMS| Constructor and Description |
|---|
CompletionFieldMapper(java.lang.String simpleName,
MappedFieldType fieldType,
Settings indexSettings,
FieldMapper.MultiFields multiFields,
FieldMapper.CopyTo copyTo,
int maxInputLength) |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
contentType() |
protected void |
doMerge(Mapper mergeWith,
boolean updateAllTypes)
Merge changes coming from
mergeWith in place. |
CompletionFieldMapper.CompletionFieldType |
fieldType() |
Mapper |
parse(ParseContext context)
Parses and indexes inputs
Parsing:
Acceptable format:
"STRING" - interpreted as field value (input)
"ARRAY" - each element can be one of "OBJECT" (see below)
"OBJECT" - { "input": STRING|ARRAY, "weight": STRING|INT, "contexts": ARRAY|OBJECT }
Indexing:
if context mappings are defined, delegates to
ContextMappings.addField(ParseContext.Document, String, String, int, Map)
else adds inputs as a SuggestField |
protected void |
parseCreateField(ParseContext context,
java.util.List<org.apache.lucene.document.Field> fields)
Parse the field value and populate
fields. |
XContentBuilder |
toXContent(XContentBuilder builder,
ToXContent.Params params) |
clone, copyTo, customBoost, doXContentAnalyzers, doXContentBody, doXContentDocValues, indexOptionToString, indexTokenizeOption, iterator, merge, name, termVectorOptionsToString, updateFieldTypesimpleNamepublic static final java.lang.String CONTENT_TYPE
public static final java.util.Set<java.lang.String> ALLOWED_CONTENT_FIELD_NAMES
public CompletionFieldMapper(java.lang.String simpleName,
MappedFieldType fieldType,
Settings indexSettings,
FieldMapper.MultiFields multiFields,
FieldMapper.CopyTo copyTo,
int maxInputLength)
public CompletionFieldMapper.CompletionFieldType fieldType()
fieldType in class FieldMapperpublic Mapper parse(ParseContext context) throws java.io.IOException
ContextMappings.addField(ParseContext.Document, String, String, int, Map)
else adds inputs as a SuggestFieldparse in class FieldMapperjava.io.IOExceptionpublic XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent in interface ToXContenttoXContent in class FieldMapperjava.io.IOExceptionprotected void parseCreateField(ParseContext context, java.util.List<org.apache.lucene.document.Field> fields) throws java.io.IOException
FieldMapperfields.parseCreateField in class FieldMapperjava.io.IOExceptionprotected java.lang.String contentType()
contentType in class FieldMapperprotected void doMerge(Mapper mergeWith, boolean updateAllTypes)
FieldMappermergeWith in place.doMerge in class FieldMapperupdateAllTypes - TODO