Package org.elasticsearch.index.mapper
Class FieldMapper
java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldMapper
- All Implemented Interfaces:
java.lang.Cloneable,java.lang.Iterable<Mapper>,org.elasticsearch.common.xcontent.ToXContent,org.elasticsearch.common.xcontent.ToXContentFragment
- Direct Known Subclasses:
AbstractGeometryFieldMapper,DynamicKeyFieldMapper,ParametrizedFieldMapper
public abstract class FieldMapper extends Mapper implements java.lang.Cloneable
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldMapper.Builder<T extends FieldMapper.Builder<T>>static classFieldMapper.CopyToRepresents a list of fields with optional boost factor where the current field should be copied tostatic classFieldMapper.MultiFieldsNested classes/interfaces inherited from class org.elasticsearch.index.mapper.Mapper
Mapper.BuilderContext, Mapper.TypeParser -
Field Summary
Fields Modifier and Type Field Description static Setting<java.lang.Boolean>COERCE_SETTINGprotected FieldMapper.CopyTocopyToprotected org.apache.lucene.document.FieldTypefieldTypestatic Setting<java.lang.Boolean>IGNORE_MALFORMED_SETTINGprotected MappedFieldTypemappedFieldTypeprotected FieldMapper.MultiFieldsmultiFields -
Constructor Summary
Constructors Modifier Constructor Description protectedFieldMapper(java.lang.String simpleName, org.apache.lucene.document.FieldType fieldType, MappedFieldType mappedFieldType, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo) -
Method Summary
Modifier and Type Method Description protected FieldMapperclone()protected abstract java.lang.StringcontentType()FieldMapper.CopyTocopyTo()List of fields where this field should be copied toprotected voidcreateFieldNamesField(ParseContext context)protected booleandocValuesByDefault()protected voiddoValidate(MappingLookup mappers)protected voiddoXContentAnalyzers(org.elasticsearch.common.xcontent.XContentBuilder builder, boolean includeDefaults)protected voiddoXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, boolean includeDefaults, org.elasticsearch.common.xcontent.ToXContent.Params params)MappedFieldTypefieldType()protected booleanindexedByDefault()protected static java.lang.StringindexOptionToString(org.apache.lucene.index.IndexOptions indexOption)java.util.Iterator<Mapper>iterator()FieldMappermerge(Mapper mergeWith)Return the merge ofmergeWithinto this.protected abstract voidmergeOptions(FieldMapper other, java.util.List<java.lang.String> conflicts)Merge type-specific options and check for incompatible settings in mappings to be mergedFieldMapper.MultiFieldsmultiFields()java.lang.Stringname()Returns the canonical name which uniquely identifies the mapper against other mappers in a type.voidparse(ParseContext context)Parse the field value using the providedParseContext.protected abstract voidparseCreateField(ParseContext context)Parse the field value and populate the fields onParseContext.doc().booleanparsesArrayValue()Whether this mapper can handle an array value during document parsing.protected booleanstoredByDefault()org.elasticsearch.common.xcontent.XContentBuildertoXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params)java.lang.StringtypeName()Returns a name representing the type of this mapper.voidvalidate(MappingLookup mappers)Validate any cross-field references made by this mapper
-
Field Details
-
IGNORE_MALFORMED_SETTING
-
COERCE_SETTING
-
fieldType
protected org.apache.lucene.document.FieldType fieldType -
mappedFieldType
-
multiFields
-
copyTo
-
-
Constructor Details
-
FieldMapper
protected FieldMapper(java.lang.String simpleName, org.apache.lucene.document.FieldType fieldType, MappedFieldType mappedFieldType, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo)
-
-
Method Details
-
name
public java.lang.String name()Description copied from class:MapperReturns the canonical name which uniquely identifies the mapper against other mappers in a type. -
typeName
public java.lang.String typeName()Description copied from class:MapperReturns a name representing the type of this mapper. -
fieldType
-
copyTo
List of fields where this field should be copied to -
multiFields
-
parsesArrayValue
public boolean parsesArrayValue()Whether this mapper can handle an array value during document parsing. If true, when an array is encountered during parsing, the document parser will pass the whole array to the mapper. If false, the array is split into individual values and each value is passed to the mapper for parsing. -
parse
Parse the field value using the providedParseContext.- Throws:
java.io.IOException
-
parseCreateField
Parse the field value and populate the fields onParseContext.doc(). Implementations of this method should ensure that on failing to parse parser.currentToken() must be the current failing token- Throws:
java.io.IOException
-
createFieldNamesField
-
iterator
- Specified by:
iteratorin interfacejava.lang.Iterable<Mapper>
-
clone
- Overrides:
clonein classjava.lang.Object
-
validate
Description copied from class:MapperValidate any cross-field references made by this mapper- Specified by:
validatein classMapper- Parameters:
mappers- aMappingLookupthat can produce references to other mappers
-
doValidate
-
merge
Description copied from class:MapperReturn the merge ofmergeWithinto this. BoththisandmergeWithwill be left unmodified. -
mergeOptions
protected abstract void mergeOptions(FieldMapper other, java.util.List<java.lang.String> conflicts)Merge type-specific options and check for incompatible settings in mappings to be merged -
toXContent
public org.elasticsearch.common.xcontent.XContentBuilder toXContent(org.elasticsearch.common.xcontent.XContentBuilder builder, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Specified by:
toXContentin interfaceorg.elasticsearch.common.xcontent.ToXContent- Throws:
java.io.IOException
-
indexedByDefault
protected boolean indexedByDefault() -
docValuesByDefault
protected boolean docValuesByDefault() -
storedByDefault
protected boolean storedByDefault() -
doXContentBody
protected void doXContentBody(org.elasticsearch.common.xcontent.XContentBuilder builder, boolean includeDefaults, org.elasticsearch.common.xcontent.ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-
doXContentAnalyzers
protected final void doXContentAnalyzers(org.elasticsearch.common.xcontent.XContentBuilder builder, boolean includeDefaults) throws java.io.IOException- Throws:
java.io.IOException
-
indexOptionToString
protected static java.lang.String indexOptionToString(org.apache.lucene.index.IndexOptions indexOption) -
contentType
protected abstract java.lang.String contentType()
-