Module org.elasticsearch.server
Package org.elasticsearch.index.mapper
Class AbstractGeometryFieldMapper<T>
java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldMapper
org.elasticsearch.index.mapper.AbstractGeometryFieldMapper<T>
- All Implemented Interfaces:
Iterable<Mapper>,ToXContent,ToXContentFragment
- Direct Known Subclasses:
AbstractPointGeometryFieldMapper,AbstractShapeGeometryFieldMapper
Base field mapper class for all spatial field types
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic final recordstatic interfacestatic final recordstatic classInterface representing parser in geometry indexing pipeline.Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.FieldMapper
FieldMapper.Builder, FieldMapper.BuilderParams, FieldMapper.Conflicts, FieldMapper.CopyTo, FieldMapper.DimensionBuilder, FieldMapper.MergeValidator<T>, FieldMapper.MultiFields, FieldMapper.Parameter<T>, FieldMapper.Serializer<T>, FieldMapper.SerializerCheck<T>, FieldMapper.SyntheticSourceMode, FieldMapper.SyntheticSourceSupport, FieldMapper.TypeParserNested classes/interfaces inherited from class org.elasticsearch.index.mapper.Mapper
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.FieldMapper
builderParams, COERCE_SETTING, deprecationLogger, IGNORE_MALFORMED_SETTING, mappedFieldTypeFields 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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractGeometryFieldMapper(String simpleName, MappedFieldType mappedFieldType, FieldMapper.BuilderParams builderParams, Explicit<Boolean> ignoreMalformed, Explicit<Boolean> ignoreZValue, AbstractGeometryFieldMapper.Parser<T> parser) -
Method Summary
Modifier and TypeMethodDescriptionbooleanWill this field ignore malformed values for this field and accept the document (true) or will it reject documents with malformed values for this field (false).static FieldMapper.Parameter<Explicit<Boolean>> ignoreMalformedParam(Function<FieldMapper, Explicit<Boolean>> initializer, boolean ignoreMalformedByDefault) booleanstatic FieldMapper.Parameter<Explicit<Boolean>> ignoreZValueParam(Function<FieldMapper, Explicit<Boolean>> initializer) protected abstract voidindex(DocumentParserContext context, T geometry) Build an index document using a parsed geometryprotected voidonMalformedValue(DocumentParserContext context, XContentBuilder malformedDataForSyntheticSource, Exception cause) final voidparse(DocumentParserContext context) Parse the field value using the providedDocumentParserContext.protected voidparseCreateField(DocumentParserContext context) Parse the field value and populate the fields onDocumentParserContext.doc().final booleanWhether this mapper can handle an array value during document parsing.protected booleanWhether this mapper can handle an object value during document parsing.Methods inherited from class org.elasticsearch.index.mapper.FieldMapper
checkIncomingMergeType, contentType, copyTo, createTypeParserWithLegacySupport, doParseMultiFields, doValidate, doXContentBody, executeScript, fullPath, getMergeBuilder, getTotalFieldsCount, hasScript, indexAnalyzers, indexScriptValues, iterator, merge, multiFields, multiFieldsIterator, notFromDynamicTemplates, notInMultiFields, sourceKeepMode, sourcePathUsedBy, syntheticFieldLoader, syntheticSourceSupport, throwIndexingWithScriptParam, toXContent, typeName, validateMethods 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.xcontent.ToXContentFragment
isFragment
-
Field Details
-
DEPRECATION_LOGGER
-
-
Constructor Details
-
AbstractGeometryFieldMapper
protected AbstractGeometryFieldMapper(String simpleName, MappedFieldType mappedFieldType, FieldMapper.BuilderParams builderParams, Explicit<Boolean> ignoreMalformed, Explicit<Boolean> ignoreZValue, AbstractGeometryFieldMapper.Parser<T> parser)
-
-
Method Details
-
ignoreMalformedParam
public static FieldMapper.Parameter<Explicit<Boolean>> ignoreMalformedParam(Function<FieldMapper, Explicit<Boolean>> initializer, boolean ignoreMalformedByDefault) -
ignoreZValueParam
public static FieldMapper.Parameter<Explicit<Boolean>> ignoreZValueParam(Function<FieldMapper, Explicit<Boolean>> initializer) -
fieldType
- Overrides:
fieldTypein classFieldMapper
-
parseCreateField
Description copied from class:FieldMapperParse the field value and populate the fields onDocumentParserContext.doc(). Implementations of this method should ensure that on failing to parse parser.currentToken() must be the current failing token- Specified by:
parseCreateFieldin classFieldMapper- Throws:
IOException
-
index
Build an index document using a parsed geometry- Parameters:
context- the ParseContext holding the documentgeometry- the parsed geometry object- Throws:
IOException
-
supportsParsingObject
protected boolean supportsParsingObject()Description copied from class:FieldMapperWhether this mapper can handle an object value during document parsing. When the subobjects property is set to false, and we encounter an object while parsing we need a way to understand if its fieldMapper is able to parse an object. If that's the case we can provide the entire object to the FieldMapper otherwise its name becomes the part of the dotted field name of each internal value.- Overrides:
supportsParsingObjectin classFieldMapper
-
parse
Description copied from class:FieldMapperParse the field value using the providedDocumentParserContext.- Overrides:
parsein classFieldMapper- Throws:
IOException
-
onMalformedValue
protected void onMalformedValue(DocumentParserContext context, XContentBuilder malformedDataForSyntheticSource, Exception cause) throws IOException - Throws:
IOException
-
ignoreMalformed
public boolean ignoreMalformed()Description copied from class:FieldMapperWill this field ignore malformed values for this field and accept the document (true) or will it reject documents with malformed values for this field (false). Some fields don't have a concept of "malformed" and will returnfalsehere.- Overrides:
ignoreMalformedin classFieldMapper
-
ignoreZValue
public boolean ignoreZValue() -
parsesArrayValue
public final boolean parsesArrayValue()Description copied from class:FieldMapperWhether this mapper can handle an array value during document parsing. If true, when an array is encountered during parsing, the document parser will pass the whole array to the mapper. If false, the array is split into individual values and each value is passed to the mapper for parsing.- Overrides:
parsesArrayValuein classFieldMapper
-