Package org.elasticsearch.index.mapper
Class ObjectMapper
- java.lang.Object
-
- org.elasticsearch.index.mapper.Mapper
-
- org.elasticsearch.index.mapper.ObjectMapper
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.lang.Iterable<Mapper>
,ToXContent
,ToXContentFragment
- Direct Known Subclasses:
RootObjectMapper
public class ObjectMapper extends Mapper implements java.lang.Cloneable
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ObjectMapper.Builder<T extends ObjectMapper.Builder,Y extends ObjectMapper>
static class
ObjectMapper.Defaults
static class
ObjectMapper.Dynamic
static class
ObjectMapper.Nested
static class
ObjectMapper.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 java.lang.String
CONTENT_TYPE
static java.lang.String
NESTED_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 ObjectMapper
clone()
protected void
doMerge(ObjectMapper mergeWith)
protected void
doXContent(XContentBuilder builder, ToXContent.Params params)
ObjectMapper.Dynamic
dynamic()
java.lang.String
fullPath()
Mapper
getMapper(java.lang.String field)
ObjectMapper
getParentObjectMapper(MapperService mapperService)
Returns the parentObjectMapper
instance of the specified object mapper ornull
if there isn't any.boolean
isEnabled()
java.util.Iterator<Mapper>
iterator()
ObjectMapper
mappingUpdate(Mapper mapper)
Build a mapping update with the provided sub mapping update.ObjectMapper
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.ObjectMapper.Nested
nested()
org.apache.lucene.search.Query
nestedTypeFilter()
java.lang.String
nestedTypePathAsString()
boolean
parentObjectMapperAreNested(MapperService mapperService)
Returns whether all parent objects fields are nested too.protected void
putMapper(Mapper mapper)
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
void
toXContent(XContentBuilder builder, ToXContent.Params params, ToXContent custom)
java.lang.String
typeName()
Returns a name representing the the type of this mapper.ObjectMapper
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
-
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE
- See Also:
- Constant Field Values
-
NESTED_CONTENT_TYPE
public static final java.lang.String NESTED_CONTENT_TYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
clone
protected ObjectMapper clone()
- Overrides:
clone
in classjava.lang.Object
-
mappingUpdate
public ObjectMapper mappingUpdate(Mapper mapper)
Build a mapping update with the provided sub mapping update.
-
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.
-
isEnabled
public boolean isEnabled()
-
getMapper
public Mapper getMapper(java.lang.String field)
-
nested
public ObjectMapper.Nested nested()
-
nestedTypeFilter
public org.apache.lucene.search.Query nestedTypeFilter()
-
putMapper
protected void putMapper(Mapper mapper)
-
iterator
public java.util.Iterator<Mapper> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<Mapper>
-
fullPath
public java.lang.String fullPath()
-
nestedTypePathAsString
public java.lang.String nestedTypePathAsString()
-
dynamic
public final ObjectMapper.Dynamic dynamic()
-
getParentObjectMapper
public ObjectMapper getParentObjectMapper(MapperService mapperService)
Returns the parentObjectMapper
instance of the specified object mapper ornull
if 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:Mapper
Return the merge ofmergeWith
into this. Boththis
andmergeWith
will be left unmodified.
-
doMerge
protected void doMerge(ObjectMapper mergeWith)
-
updateFieldType
public ObjectMapper 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
-
toXContent
public void toXContent(XContentBuilder builder, ToXContent.Params params, ToXContent custom) throws java.io.IOException
- Throws:
java.io.IOException
-
doXContent
protected void doXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException
- Throws:
java.io.IOException
-
-