Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
Class PassThroughObjectMapper
java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.ObjectMapper
org.elasticsearch.index.mapper.PassThroughObjectMapper
- All Implemented Interfaces:
Iterable<Mapper>,PassThroughFieldSource,ToXContent,ToXContentFragment
Mapper for pass-through objects.
Pass-through objects allow creating fields inside them that can also be referenced directly in search queries.
They also include parameters that affect how nested fields get configured. For instance, if parameter "time_series_dimension"
is set, eligible subfields are marked as dimensions and keyword fields are additionally included in routing and tsid calculations.
In case different pass-through objects contain subfields with the same name (excluding the pass-through prefix), their aliases conflict.
To resolve this, the pass-through spec specifies which object takes precedence through required parameter "priority"; non-negative
integer values are accepted, with the highest priority value winning in case of conflicting aliases.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classNested classes/interfaces inherited from class org.elasticsearch.index.mapper.ObjectMapper
ObjectMapper.Defaults, ObjectMapper.Dynamic, ObjectMapper.SubobjectsNested classes/interfaces inherited from class org.elasticsearch.index.mapper.Mapper
Mapper.IgnoreAbove, Mapper.SourceKeepModeNested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.Params -
Field Summary
FieldsFields inherited from class org.elasticsearch.index.mapper.ObjectMapper
dynamic, enabled, mappers, sourceKeepMode, subobjectsFields inherited from class org.elasticsearch.index.mapper.Mapper
SYNTHETIC_SOURCE_KEEP_INDEX_SETTING, SYNTHETIC_SOURCE_KEEP_PARAMFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcheckForDuplicatePriorities(Collection<? extends PassThroughFieldSource> passThroughSources) Checks the passed sources for duplicate priorities.booleannewBuilder(IndexVersion indexVersionCreated) The set of sub-field mappers whoseMapper.leafName()should be registered as root-level aliases.intpriority()The non-negative priority used to resolve conflicts when multiple passthrough sources expose sub-fields with the same leaf name at the root level.toXContent(XContentBuilder builder, ToXContent.Params params) typeName()Returns a name representing the type of this mapper.Methods inherited from class org.elasticsearch.index.mapper.ObjectMapper
doXContent, dynamic, findParentMapper, fullPath, getMapper, getTotalFieldsCount, isEnabled, isNested, isRoot, iterator, serializeMappers, sourceKeepMode, subobjects, validate, validateSubFieldMethods inherited from class org.elasticsearch.index.mapper.Mapper
freezeAndDeduplicateFieldType, getOffsetFieldName, internFieldName, leafName, supportStoringArrayOffsets, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.elasticsearch.index.mapper.PassThroughFieldSource
fullPathMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
CONTENT_TYPE
- See Also:
-
PRIORITY_PARAM_NAME
- See Also:
-
-
Method Details
-
typeName
Description copied from class:MapperReturns a name representing the type of this mapper.- Overrides:
typeNamein classObjectMapper
-
containsDimensions
public boolean containsDimensions() -
priority
public int priority()Description copied from interface:PassThroughFieldSourceThe non-negative priority used to resolve conflicts when multiple passthrough sources expose sub-fields with the same leaf name at the root level. Higher priority wins.- Specified by:
priorityin interfacePassThroughFieldSource
-
passThroughSubFields
Description copied from interface:PassThroughFieldSourceThe set of sub-field mappers whoseMapper.leafName()should be registered as root-level aliases. Returns an empty collection when passthrough is disabled or there are no eligible sub-fields.- Specified by:
passThroughSubFieldsin interfacePassThroughFieldSource
-
timeSeriesDimensionSubFields
-
newBuilder
- Overrides:
newBuilderin classObjectMapper- Returns:
- a Builder that will produce an empty ObjectMapper with the same configuration as this one
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Overrides:
toXContentin classObjectMapper- Throws:
IOException
-
checkForDuplicatePriorities
public static void checkForDuplicatePriorities(Collection<? extends PassThroughFieldSource> passThroughSources) Checks the passed sources for duplicate priorities.- Parameters:
passThroughSources- sources to check
-