Package org.elasticsearch.index.mapper
Class FieldAliasMapper
java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldAliasMapper
- All Implemented Interfaces:
java.lang.Iterable<Mapper>
,ToXContent
,ToXContentFragment
public final class FieldAliasMapper extends Mapper
A mapper for field aliases.
A field alias has no concrete field mappings of its own, but instead points to another field by
its path. Once defined, an alias can be used in place of the concrete field name in search requests.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FieldAliasMapper.Builder
static class
FieldAliasMapper.Names
static class
FieldAliasMapper.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
-
Constructor Summary
Constructors Constructor Description FieldAliasMapper(java.lang.String simpleName, java.lang.String name, java.lang.String path)
-
Method Summary
Modifier and Type Method Description java.util.Iterator<Mapper>
iterator()
Mapper
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.java.lang.String
path()
XContentBuilder
toXContent(XContentBuilder builder, ToXContent.Params params)
java.lang.String
typeName()
Returns a name representing the type of this mapper.Mapper
updateFieldType(java.util.Map<java.lang.String,MappedFieldType> fullNameToFieldType)
Update the field type of this mapper.
-
Field Details
-
CONTENT_TYPE
public static final java.lang.String CONTENT_TYPE- See Also:
- Constant Field Values
-
-
Constructor Details
-
FieldAliasMapper
public FieldAliasMapper(java.lang.String simpleName, java.lang.String name, java.lang.String path)
-
-
Method Details
-
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 type of this mapper. -
path
public java.lang.String path() -
merge
Description copied from class:Mapper
Return the merge ofmergeWith
into this. Boththis
andmergeWith
will be left unmodified. -
updateFieldType
public Mapper 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
-
iterator
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws java.io.IOException- Throws:
java.io.IOException
-