Package org.elasticsearch.index.mapper
Class RootObjectMapper
- java.lang.Object
-
- org.elasticsearch.index.mapper.Mapper
-
- org.elasticsearch.index.mapper.ObjectMapper
-
- org.elasticsearch.index.mapper.RootObjectMapper
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Iterable<Mapper>
,ToXContent
,ToXContentFragment
public class RootObjectMapper extends ObjectMapper
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RootObjectMapper.Builder
static class
RootObjectMapper.Defaults
static class
RootObjectMapper.TypeParser
-
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.ObjectMapper
ObjectMapper.Dynamic, ObjectMapper.Nested
-
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.Mapper
Mapper.BuilderContext
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.index.mapper.ObjectMapper
CONTENT_TYPE, NESTED_CONTENT_TYPE
-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Method Summary
Modifier and Type Method Description boolean
dateDetection()
protected void
doMerge(ObjectMapper mergeWith, boolean updateAllTypes)
protected void
doXContent(XContentBuilder builder, ToXContent.Params params)
DateFormatter[]
dynamicDateTimeFormatters()
DynamicTemplate
findTemplate(ContentPath path, java.lang.String name, DynamicTemplate.XContentFieldType matchType)
Mapper.Builder
findTemplateBuilder(ParseContext context, java.lang.String name, java.lang.String dynamicType, DynamicTemplate.XContentFieldType matchType)
Find a template.Mapper.Builder
findTemplateBuilder(ParseContext context, java.lang.String name, DynamicTemplate.XContentFieldType matchType)
ObjectMapper
mappingUpdate(Mapper mapper)
Build a mapping update with the provided sub mapping update.RootObjectMapper
merge(Mapper mergeWith, boolean updateAllTypes)
Return the merge ofmergeWith
into this.boolean
numericDetection()
RootObjectMapper
updateFieldType(java.util.Map<java.lang.String,MappedFieldType> fullNameToFieldType)
Update the field type of this mapper.-
Methods inherited from class org.elasticsearch.index.mapper.ObjectMapper
clone, dynamic, fullPath, getMapper, getParentObjectMapper, includeInAll, isEnabled, iterator, name, nested, nestedTypeFilter, nestedTypePathAsString, parentObjectMapperAreNested, putMapper, toXContent, toXContent, typeName
-
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
-
-
-
-
Method Detail
-
mappingUpdate
public ObjectMapper mappingUpdate(Mapper mapper)
Description copied from class:ObjectMapper
Build a mapping update with the provided sub mapping update.- Overrides:
mappingUpdate
in classObjectMapper
-
dateDetection
public boolean dateDetection()
-
numericDetection
public boolean numericDetection()
-
dynamicDateTimeFormatters
public DateFormatter[] dynamicDateTimeFormatters()
-
findTemplateBuilder
public Mapper.Builder findTemplateBuilder(ParseContext context, java.lang.String name, DynamicTemplate.XContentFieldType matchType)
-
findTemplateBuilder
public Mapper.Builder findTemplateBuilder(ParseContext context, java.lang.String name, java.lang.String dynamicType, DynamicTemplate.XContentFieldType matchType)
Find a template. Returnsnull
if no template could be found.- Parameters:
name
- the field namedynamicType
- the field type to give the field if the template does not define onematchType
- the type of the field in the json document or null if unknown- Returns:
- a mapper builder, or null if there is no template for such a field
-
findTemplate
public DynamicTemplate findTemplate(ContentPath path, java.lang.String name, DynamicTemplate.XContentFieldType matchType)
-
merge
public RootObjectMapper merge(Mapper mergeWith, boolean updateAllTypes)
Description copied from class:Mapper
Return the merge ofmergeWith
into this. Boththis
andmergeWith
will be left unmodified.- Overrides:
merge
in classObjectMapper
-
doMerge
protected void doMerge(ObjectMapper mergeWith, boolean updateAllTypes)
- Overrides:
doMerge
in classObjectMapper
-
updateFieldType
public RootObjectMapper 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.- Overrides:
updateFieldType
in classObjectMapper
-
doXContent
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Overrides:
doXContent
in classObjectMapper
- Throws:
java.io.IOException
-
-