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>
,ToXContent
,ToXContentFragment
- Direct Known Subclasses:
BaseGeoShapeFieldMapper
,BinaryFieldMapper
,BooleanFieldMapper
,CompletionFieldMapper
,DateFieldMapper
,GeoPointFieldMapper
,IpFieldMapper
,KeywordFieldMapper
,MetadataFieldMapper
,NumberFieldMapper
,RangeFieldMapper
,TextFieldMapper
public abstract class FieldMapper extends Mapper implements java.lang.Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldMapper.Builder<T extends FieldMapper.Builder,Y extends FieldMapper>
static class
FieldMapper.CopyTo
Represents a list of fields with optional boost factor where the current field should be copied tostatic class
FieldMapper.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<java.lang.Boolean>
COERCE_SETTING
protected FieldMapper.CopyTo
copyTo
protected MappedFieldType
defaultFieldType
protected MappedFieldType
fieldType
static Setting<java.lang.Boolean>
IGNORE_MALFORMED_SETTING
protected Version
indexCreatedVersion
protected FieldMapper.MultiFields
multiFields
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
FieldMapper(java.lang.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 FieldMapper
clone()
protected abstract java.lang.String
contentType()
FieldMapper.CopyTo
copyTo()
List of fields where this field should be copied toprotected void
createFieldNamesField(ParseContext context, java.util.List<org.apache.lucene.index.IndexableField> fields)
protected void
doMerge(Mapper mergeWith)
Merge changes coming frommergeWith
in place.protected void
doXContentAnalyzers(XContentBuilder builder, boolean includeDefaults)
protected void
doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params)
protected void
doXContentDocValues(XContentBuilder builder, boolean includeDefaults)
MappedFieldType
fieldType()
protected static java.lang.String
indexOptionToString(org.apache.lucene.index.IndexOptions indexOption)
java.util.Iterator<Mapper>
iterator()
FieldMapper
merge(Mapper mergeWith)
Return the merge ofmergeWith
into this.java.lang.String
name()
Returns the canonical name which uniquely identifies the mapper against other mappers in a type.void
parse(ParseContext context)
Parse the field value using the providedParseContext
.protected abstract void
parseCreateField(ParseContext context, java.util.List<org.apache.lucene.index.IndexableField> fields)
Parse the field value and populatefields
.static java.lang.String
termVectorOptionsToString(org.apache.lucene.document.FieldType fieldType)
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
java.lang.String
typeName()
Returns a name representing the the type of this mapper.FieldMapper
updateFieldType(java.util.Map<java.lang.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 org.elasticsearch.common.xcontent.ToXContentFragment
isFragment
-
-
-
-
Field Detail
-
IGNORE_MALFORMED_SETTING
public static final Setting<java.lang.Boolean> IGNORE_MALFORMED_SETTING
-
COERCE_SETTING
public static final Setting<java.lang.Boolean> COERCE_SETTING
-
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(java.lang.String simpleName, MappedFieldType fieldType, MappedFieldType defaultFieldType, Settings indexSettings, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo)
-
-
Method Detail
-
name
public java.lang.String name()
Description copied from class:Mapper
Returns the canonical name which uniquely identifies the mapper against other mappers in a type.
-
typeName
public java.lang.String typeName()
Description copied from class:Mapper
Returns a name representing the 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 java.io.IOException
Parse the field value using the providedParseContext
.- Throws:
java.io.IOException
-
parseCreateField
protected abstract void parseCreateField(ParseContext context, java.util.List<org.apache.lucene.index.IndexableField> fields) throws java.io.IOException
Parse the field value and populatefields
.- Throws:
java.io.IOException
-
createFieldNamesField
protected void createFieldNamesField(ParseContext context, java.util.List<org.apache.lucene.index.IndexableField> fields)
-
iterator
public java.util.Iterator<Mapper> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<Mapper>
-
clone
protected FieldMapper clone()
- Overrides:
clone
in classjava.lang.Object
-
merge
public FieldMapper merge(Mapper mergeWith)
Description copied from class:Mapper
Return the merge ofmergeWith
into this. Boththis
andmergeWith
will be left unmodified.
-
doMerge
protected void doMerge(Mapper mergeWith)
Merge changes coming frommergeWith
in place.
-
updateFieldType
public FieldMapper updateFieldType(java.util.Map<java.lang.String,MappedFieldType> fullNameToFieldType)
Description copied from class:Mapper
Update 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:
updateFieldType
in classMapper
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Specified by:
toXContent
in interfaceToXContent
- Throws:
java.io.IOException
-
doXContentBody
protected void doXContentBody(XContentBuilder builder, boolean includeDefaults, ToXContent.Params params) throws java.io.IOException
- Throws:
java.io.IOException
-
doXContentAnalyzers
protected final void doXContentAnalyzers(XContentBuilder builder, boolean includeDefaults) throws java.io.IOException
- Throws:
java.io.IOException
-
doXContentDocValues
protected void doXContentDocValues(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)
-
termVectorOptionsToString
public static java.lang.String termVectorOptionsToString(org.apache.lucene.document.FieldType fieldType)
-
contentType
protected abstract java.lang.String contentType()
-
-