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.MultiFields
Mapper.BuilderContext
ToXContent.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, indexCreatedVersion, multiFields
EMPTY_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.index.IndexableField> 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, updateFieldType
simpleName
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
isFragment
public 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 FieldMapper
public Mapper parse(ParseContext context) throws java.io.IOException
ContextMappings.addField(ParseContext.Document, String, String, int, Map)
else adds inputs as a SuggestField
parse
in class FieldMapper
java.io.IOException
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
toXContent
in interface ToXContent
toXContent
in class FieldMapper
java.io.IOException
protected void parseCreateField(ParseContext context, java.util.List<org.apache.lucene.index.IndexableField> fields) throws java.io.IOException
FieldMapper
fields
.parseCreateField
in class FieldMapper
java.io.IOException
protected java.lang.String contentType()
contentType
in class FieldMapper
protected void doMerge(Mapper mergeWith, boolean updateAllTypes)
FieldMapper
mergeWith
in place.doMerge
in class FieldMapper
updateAllTypes
- TODO