java.lang.Object
org.elasticsearch.index.mapper.Mapper
- All Implemented Interfaces:
Iterable<Mapper>
,ToXContent
,ToXContentFragment
- Direct Known Subclasses:
FieldAliasMapper
,FieldMapper
,ObjectMapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params
-
Field Summary
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.lucene.document.FieldType
freezeAndDeduplicateFieldType
(org.apache.lucene.document.FieldType fieldType) Freezes the givenFieldType
instances and tries to deduplicate it as long as the field does not return a non-empty value forFieldType.getAttributes()
.static String
internFieldName
(String fieldName) Interns the given field name string through aStringLiteralDeduplicator
.abstract Mapper
merge
(Mapper mergeWith, MapperBuilderContext mapperBuilderContext) Return the merge ofmergeWith
into this.abstract String
name()
Returns the canonical name which uniquely identifies the mapper against other mappers in a type.final String
Returns the simple name, which identifies this mapper against other mappers at the same level in the mappers hierarchy TODO: make this protected once Mapper and FieldMapper are merged togetherCreate aSourceLoader.SyntheticFieldLoader
to populate synthetic source.toString()
abstract String
typeName()
Returns a name representing the type of this mapper.abstract void
validate
(MappingLookup mappers) Validate any cross-field references made by this mapperMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Constructor Details
-
Mapper
-
-
Method Details
-
simpleName
Returns the simple name, which identifies this mapper against other mappers at the same level in the mappers hierarchy TODO: make this protected once Mapper and FieldMapper are merged together -
name
Returns the canonical name which uniquely identifies the mapper against other mappers in a type. -
typeName
Returns a name representing the type of this mapper. -
merge
Return the merge ofmergeWith
into this. Boththis
andmergeWith
will be left unmodified. -
validate
Validate any cross-field references made by this mapper- Parameters:
mappers
- aMappingLookup
that can produce references to other mappers
-
syntheticFieldLoader
Create aSourceLoader.SyntheticFieldLoader
to populate synthetic source.- Throws:
IllegalArgumentException
- if the field is configured in a way that doesn't support synthetic source. This translates nicely into a 400 error when users configure synthetic source in the mapping without configuring all fields properly.
-
toString
-
internFieldName
Interns the given field name string through aStringLiteralDeduplicator
.- Parameters:
fieldName
- field name to intern- Returns:
- interned field name string
-
freezeAndDeduplicateFieldType
public static org.apache.lucene.document.FieldType freezeAndDeduplicateFieldType(org.apache.lucene.document.FieldType fieldType) Freezes the givenFieldType
instances and tries to deduplicate it as long as the field does not return a non-empty value forFieldType.getAttributes()
.- Parameters:
fieldType
- field type to deduplicate- Returns:
- deduplicated field type
-