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 ClassesNested 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.apache.lucene.document.FieldTypefreezeAndDeduplicateFieldType(org.apache.lucene.document.FieldType fieldType) Freezes the givenFieldTypeinstances and tries to deduplicate it as long as the field does not return a non-empty value forFieldType.getAttributes().abstract intThe total number of fields as defined in the mapping.static StringinternFieldName(String fieldName) Interns the given field name string through aStringLiteralDeduplicator.abstract Mappermerge(Mapper mergeWith, MapperMergeContext mapperMergeContext) Return the merge ofmergeWithinto this.abstract Stringname()Returns the canonical name which uniquely identifies the mapper against other mappers in a type.final StringReturns 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.SyntheticFieldLoaderto populate synthetic source.toString()abstract StringtypeName()Returns a name representing the type of this mapper.abstract voidvalidate(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, waitMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContentMethods 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 ofmergeWithinto this. BoththisandmergeWithwill be left unmodified. -
validate
Validate any cross-field references made by this mapper- Parameters:
mappers- aMappingLookupthat can produce references to other mappers
-
syntheticFieldLoader
Create aSourceLoader.SyntheticFieldLoaderto 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 givenFieldTypeinstances 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
-
getTotalFieldsCount
public abstract int getTotalFieldsCount()The total number of fields as defined in the mapping. Defines how this mapper counts towardsMapperService.INDEX_MAPPING_TOTAL_FIELDS_LIMIT_SETTING.
-