Package org.elasticsearch.index.mapper
Interface RuntimeField
- All Superinterfaces:
ToXContent
,ToXContentFragment
- All Known Implementing Classes:
CompositeRuntimeField
,LeafRuntimeField
Definition of a runtime field that can be defined as part of the runtime section of the index mappings
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static final class
Parser for a runtime field.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_PARAMS
-
Method Summary
Modifier and TypeMethodDescriptionExposes theMappedFieldType
s backing this runtime field, used to execute queries, run aggs etc.static Map<String,
MappedFieldType> collectFieldTypes
(Collection<RuntimeField> runtimeFields) Collect and return allMappedFieldType
exposed by the providedRuntimeField
s.static <T> Function<FieldMapper,
T> name()
Exposes the name of the runtime fieldstatic Map<String,
RuntimeField> parseRuntimeFields
(Map<String, Object> node, MappingParserContext parserContext, boolean supportsRemoval) Parse runtime fields from the provided map, using the provided parser context.static Map<String,
RuntimeField> parseRuntimeFields
(Map<String, Object> node, MappingParserContext parserContext, Function<RuntimeField.Builder, RuntimeField> builder, boolean supportsRemoval) Parse runtime fields from the provided map, using the provided parser context.static Script
parseScript
(String name, MappingParserContext parserContext, Object scriptObject) Methods inherited from interface org.elasticsearch.xcontent.ToXContent
toXContent
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Method Details
-
name
String name()Exposes the name of the runtime field- Returns:
- name of the field
-
asMappedFieldTypes
Stream<MappedFieldType> asMappedFieldTypes()Exposes theMappedFieldType
s backing this runtime field, used to execute queries, run aggs etc.- Returns:
- the
MappedFieldType
s backing this runtime field
-
parseRuntimeFields
static Map<String,RuntimeField> parseRuntimeFields(Map<String, Object> node, MappingParserContext parserContext, boolean supportsRemoval) Parse runtime fields from the provided map, using the provided parser context.- Parameters:
node
- the map that holds the runtime fields configurationparserContext
- the parser context that holds info needed when parsing mappingssupportsRemoval
- whether a null value for a runtime field should be properly parsed and translated to the removal of such runtime field- Returns:
- the parsed runtime fields
-
parseRuntimeFields
static Map<String,RuntimeField> parseRuntimeFields(Map<String, Object> node, MappingParserContext parserContext, Function<RuntimeField.Builder, RuntimeField> builder, boolean supportsRemoval) Parse runtime fields from the provided map, using the provided parser context. This method also allows you to define how the runtime field will be created from its builder, so that it can be used by composite fields to build child fields using parent factory parameters.- Parameters:
node
- the map that holds the runtime fields configurationparserContext
- the parser context that holds info needed when parsing mappingsbuilder
- a function to convert a RuntimeField.Builder into a RuntimeFieldsupportsRemoval
- whether a null value for a runtime field should be properly parsed and translated to the removal of such runtime field- Returns:
- the parsed runtime fields
-
collectFieldTypes
Collect and return allMappedFieldType
exposed by the providedRuntimeField
s. Note that validation is performed to make sure that there are no name clashes among the collected runtime fields. This is because runtime fields with the same name are not accepted as part of the same section.- Parameters:
runtimeFields
- the runtime to extract the mapped field types from- Returns:
- the collected mapped field types
-
initializerNotSupported
-
parseScript
-