Package org.opensearch.index.mapper
Class DerivedFieldMapper
java.lang.Object
org.opensearch.index.mapper.Mapper
org.opensearch.index.mapper.FieldMapper
org.opensearch.index.mapper.ParametrizedFieldMapper
org.opensearch.index.mapper.DerivedFieldMapper
- All Implemented Interfaces:
Cloneable
,Iterable<Mapper>
,org.opensearch.core.xcontent.ToXContent
,org.opensearch.core.xcontent.ToXContentFragment
A field mapper for derived fields
- Opensearch.internal:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Builder for this field mapperNested classes/interfaces inherited from class org.opensearch.index.mapper.ParametrizedFieldMapper
ParametrizedFieldMapper.Parameter<T>, ParametrizedFieldMapper.Serializer<T>, ParametrizedFieldMapper.SerializerCheck<T>, ParametrizedFieldMapper.TypeParser
Nested classes/interfaces inherited from class org.opensearch.index.mapper.FieldMapper
FieldMapper.CopyTo, FieldMapper.MultiFields
Nested classes/interfaces inherited from class org.opensearch.index.mapper.Mapper
Mapper.BuilderContext
Nested classes/interfaces inherited from interface org.opensearch.core.xcontent.ToXContent
org.opensearch.core.xcontent.ToXContent.DelegatingMapParams, org.opensearch.core.xcontent.ToXContent.MapParams, org.opensearch.core.xcontent.ToXContent.Params
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
protected final IndexAnalyzers
static final ParametrizedFieldMapper.TypeParser
Fields inherited from class org.opensearch.index.mapper.FieldMapper
COERCE_SETTING, copyTo, fieldType, IGNORE_MALFORMED_SETTING, mappedFieldType, multiFields
Fields inherited from interface org.opensearch.core.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ModifierConstructorDescriptionprotected
DerivedFieldMapper
(String simpleName, MappedFieldType mappedFieldType, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo, DerivedFieldMapper.Builder builder, IndexAnalyzers indexAnalyzers, DateFormatter defaultDateFormatter, boolean ignoreMalformed) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected void
doXContentBody
(org.opensearch.core.xcontent.XContentBuilder builder, boolean includeDefaults, org.opensearch.core.xcontent.ToXContent.Params params) Returns aParametrizedFieldMapper.Builder
to be used for merging and serializationgetType()
protected void
parseCreateField
(ParseContext context) Parse the field value and populate the fields onParseContext.doc()
.Methods inherited from class org.opensearch.index.mapper.ParametrizedFieldMapper
merge, mergeOptions
Methods inherited from class org.opensearch.index.mapper.FieldMapper
clone, copyTo, createFieldNamesField, docValuesByDefault, doValidate, doXContentAnalyzers, indexedByDefault, indexOptionToString, iterator, multiFields, name, parse, parsesArrayValue, storedByDefault, toXContent, typeName, validate
Methods inherited from class org.opensearch.index.mapper.Mapper
hasIndexCreated, simpleName
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.opensearch.core.xcontent.ToXContentFragment
isFragment
-
Field Details
-
CONTENT_TYPE
- See Also:
-
indexAnalyzers
-
PARSER
-
-
Constructor Details
-
DerivedFieldMapper
protected DerivedFieldMapper(String simpleName, MappedFieldType mappedFieldType, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo, DerivedFieldMapper.Builder builder, IndexAnalyzers indexAnalyzers, DateFormatter defaultDateFormatter, boolean ignoreMalformed)
-
-
Method Details
-
fieldType
- Overrides:
fieldType
in classFieldMapper
-
parseCreateField
Description copied from class:FieldMapper
Parse the field value and populate the fields onParseContext.doc()
.Implementations of this method should ensure that on failing to parse parser.currentToken() must be the current failing token
- Specified by:
parseCreateField
in classFieldMapper
- Throws:
IOException
-
getMergeBuilder
Description copied from class:ParametrizedFieldMapper
Returns aParametrizedFieldMapper.Builder
to be used for merging and serializationImplement as follows:
return new MyBuilder(simpleName()).init(this);
- Specified by:
getMergeBuilder
in classParametrizedFieldMapper
-
contentType
- Specified by:
contentType
in classFieldMapper
-
doXContentBody
protected void doXContentBody(org.opensearch.core.xcontent.XContentBuilder builder, boolean includeDefaults, org.opensearch.core.xcontent.ToXContent.Params params) throws IOException - Overrides:
doXContentBody
in classParametrizedFieldMapper
- Throws:
IOException
-
getType
-
getScript
-