Package org.elasticsearch.index.mapper
Class ObjectMapper
- java.lang.Object
-
- org.elasticsearch.index.mapper.Mapper
-
- org.elasticsearch.index.mapper.ObjectMapper
-
- All Implemented Interfaces:
Cloneable,Iterable<Mapper>,ToXContent,ToXContentFragment
- Direct Known Subclasses:
RootObjectMapper
public class ObjectMapper extends Mapper implements Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classObjectMapper.Builder<T extends ObjectMapper.Builder,Y extends ObjectMapper>static classObjectMapper.Defaultsstatic classObjectMapper.Dynamicstatic classObjectMapper.Nestedstatic classObjectMapper.TypeParser-
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 Modifier and Type Field Description static StringCONTENT_TYPEstatic StringNESTED_CONTENT_TYPE-
Fields inherited from interface org.elasticsearch.common.xcontent.ToXContent
EMPTY_PARAMS
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ObjectMapperclone()protected voiddoMerge(ObjectMapper mergeWith)protected voiddoXContent(XContentBuilder builder, ToXContent.Params params)ObjectMapper.Dynamicdynamic()StringfullPath()MappergetMapper(String field)ObjectMappergetParentObjectMapper(MapperService mapperService)Returns the parentObjectMapperinstance of the specified object mapper ornullif there isn't any.booleanisEnabled()Iterator<Mapper>iterator()ObjectMappermappingUpdate(Mapper mapper)Build a mapping update with the provided sub mapping update.ObjectMappermerge(Mapper mergeWith)Return the merge ofmergeWithinto this.Stringname()Returns the canonical name which uniquely identifies the mapper against other mappers in a type.ObjectMapper.Nestednested()QuerynestedTypeFilter()StringnestedTypePathAsString()booleanparentObjectMapperAreNested(MapperService mapperService)Returns whether all parent objects fields are nested too.protected voidputMapper(Mapper mapper)XContentBuildertoXContent(XContentBuilder builder, ToXContent.Params params)voidtoXContent(XContentBuilder builder, ToXContent.Params params, ToXContent custom)StringtypeName()Returns a name representing the type of this mapper.ObjectMapperupdateFieldType(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
-
CONTENT_TYPE
public static final String CONTENT_TYPE
- See Also:
- Constant Field Values
-
NESTED_CONTENT_TYPE
public static final String NESTED_CONTENT_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
clone
protected ObjectMapper clone()
-
mappingUpdate
public ObjectMapper mappingUpdate(Mapper mapper)
Build a mapping update with the provided sub mapping update.
-
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.
-
isEnabled
public boolean isEnabled()
-
nested
public ObjectMapper.Nested nested()
-
nestedTypeFilter
public Query nestedTypeFilter()
-
putMapper
protected void putMapper(Mapper mapper)
-
fullPath
public String fullPath()
-
nestedTypePathAsString
public String nestedTypePathAsString()
-
dynamic
public final ObjectMapper.Dynamic dynamic()
-
getParentObjectMapper
public ObjectMapper getParentObjectMapper(MapperService mapperService)
Returns the parentObjectMapperinstance of the specified object mapper ornullif there isn't any.
-
parentObjectMapperAreNested
public boolean parentObjectMapperAreNested(MapperService mapperService)
Returns whether all parent objects fields are nested too.
-
merge
public ObjectMapper merge(Mapper mergeWith)
Description copied from class:MapperReturn the merge ofmergeWithinto this. BoththisandmergeWithwill be left unmodified.
-
doMerge
protected void doMerge(ObjectMapper mergeWith)
-
updateFieldType
public ObjectMapper 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
-
toXContent
public void toXContent(XContentBuilder builder, ToXContent.Params params, ToXContent custom) throws IOException
- Throws:
IOException
-
doXContent
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws IOException
- Throws:
IOException
-
-