Package org.elasticsearch.index.mapper
Class FieldMapper
- java.lang.Object
-
- org.elasticsearch.index.mapper.Mapper
-
- org.elasticsearch.index.mapper.FieldMapper
-
- All Implemented Interfaces:
Cloneable,Iterable<Mapper>,ToXContent,ToXContentFragment
- Direct Known Subclasses:
AbstractGeometryFieldMapper,BinaryFieldMapper,BooleanFieldMapper,CompletionFieldMapper,DateFieldMapper,DynamicKeyFieldMapper,GeoPointFieldMapper,IpFieldMapper,KeywordFieldMapper,MetadataFieldMapper,NumberFieldMapper,RangeFieldMapper,TextFieldMapper
public abstract class FieldMapper extends Mapper implements Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldMapper.Builder<T extends FieldMapper.Builder,Y extends FieldMapper>static classFieldMapper.CopyToRepresents a list of fields with optional boost factor where the current field should be copied tostatic classFieldMapper.MultiFields-
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.Mapper
Mapper.BuilderContext, Mapper.TypeParser
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
Fields Modifier and Type Field Description static Setting<Boolean>COERCE_SETTINGprotected FieldMapper.CopyTocopyToprotected MappedFieldTypedefaultFieldTypeprotected MappedFieldTypefieldTypestatic Setting<Boolean>IGNORE_MALFORMED_SETTINGprotected VersionindexCreatedVersionprotected FieldMapper.MultiFieldsmultiFields-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedFieldMapper(String simpleName, MappedFieldType fieldType, MappedFieldType defaultFieldType, Settings indexSettings, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected FieldMapperclone()protected abstract StringcontentType()FieldMapper.CopyTocopyTo()List of fields where this field should be copied toprotected voidcreateFieldNamesField(ParseContext context, List<IndexableField> fields)protected voiddoMerge(Mapper mergeWith)Merge changes coming frommergeWithin place.protected voiddoXContentAnalyzers(XContentBuilder builder, boolean includeDefaults)protected voiddoXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params)protected voiddoXContentDocValues(XContentBuilder builder, boolean includeDefaults)MappedFieldTypefieldType()protected static StringindexOptionToString(IndexOptions indexOption)Iterator<Mapper>iterator()FieldMappermerge(Mapper mergeWith)Return the merge ofmergeWithinto this.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, List<IndexableField> fields)Parse the field value and populatefields.static StringtermVectorOptionsToString(FieldType fieldType)XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)StringtypeName()Returns a name representing the type of this mapper.FieldMapperupdateFieldType(Map<String,MappedFieldType> fullNameToFieldType)Update the field type of this mapper.-
Methods inherited from class org.elasticsearch.index.mapper.Mapper
simpleName
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Methods inherited from interface org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
indexCreatedVersion
protected final Version indexCreatedVersion
-
fieldType
protected MappedFieldType fieldType
-
defaultFieldType
protected final MappedFieldType defaultFieldType
-
multiFields
protected FieldMapper.MultiFields multiFields
-
copyTo
protected FieldMapper.CopyTo copyTo
-
-
Constructor Detail
-
FieldMapper
protected FieldMapper(String simpleName, MappedFieldType fieldType, MappedFieldType defaultFieldType, Settings indexSettings, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo)
-
-
Method Detail
-
name
public String name()
Description copied from class:MapperReturns the canonical name which uniquely identifies the mapper against other mappers in a type.
-
typeName
public String typeName()
Description copied from class:MapperReturns a name representing the type of this mapper.
-
fieldType
public MappedFieldType fieldType()
-
copyTo
public FieldMapper.CopyTo copyTo()
List of fields where this field should be copied to
-
parse
public void parse(ParseContext context) throws IOException
Parse the field value using the providedParseContext.- Throws:
IOException
-
parseCreateField
protected abstract void parseCreateField(ParseContext context, List<IndexableField> fields) throws IOException
Parse the field value and populatefields. Implementations of this method should ensure that on failing to parse parser.currentToken() must be the current failing token- Throws:
IOException
-
createFieldNamesField
protected void createFieldNamesField(ParseContext context, List<IndexableField> fields)
-
clone
protected FieldMapper clone()
-
merge
public FieldMapper merge(Mapper mergeWith)
Description copied from class:MapperReturn the merge ofmergeWithinto this. BoththisandmergeWithwill be left unmodified.
-
doMerge
protected void doMerge(Mapper mergeWith)
Merge changes coming frommergeWithin place.
-
updateFieldType
public FieldMapper updateFieldType(Map<String,MappedFieldType> fullNameToFieldType)
Description copied from class:MapperUpdate the field type of this mapper. This is necessary because some mapping updates can modify mappings across several types. This method must return a copy of the mapper so that the current mapper is not modified.- Specified by:
updateFieldTypein classMapper
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
doXContentBody
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws IOException
- Throws:
IOException
-
doXContentAnalyzers
protected final void doXContentAnalyzers(XContentBuilder builder, boolean includeDefaults) throws IOException
- Throws:
IOException
-
doXContentDocValues
protected void doXContentDocValues(XContentBuilder builder, boolean includeDefaults) throws IOException
- Throws:
IOException
-
indexOptionToString
protected static String indexOptionToString(IndexOptions indexOption)
-
contentType
protected abstract String contentType()
-
-