Package org.elasticsearch.index.mapper
Class GeoShapeFieldMapper
java.lang.Object
org.elasticsearch.index.mapper.Mapper
org.elasticsearch.index.mapper.FieldMapper
org.elasticsearch.index.mapper.AbstractGeometryFieldMapper<T>
org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper<org.elasticsearch.geometry.Geometry>
org.elasticsearch.index.mapper.GeoShapeFieldMapper
- All Implemented Interfaces:
Cloneable
,Iterable<Mapper>
,org.elasticsearch.xcontent.ToXContent
,org.elasticsearch.xcontent.ToXContentFragment
public class GeoShapeFieldMapper
extends AbstractShapeGeometryFieldMapper<org.elasticsearch.geometry.Geometry>
FieldMapper for indexing
LatLonShape
s.
Currently Shapes can only be indexed and can only be queried using
GeoShapeQueryBuilder
, consequently
a lot of behavior in this Mapper is disabled.
Format supported:
"field" : { "type" : "polygon", "coordinates" : [ [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ] ] }
or:
"field" : "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0))
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper
AbstractShapeGeometryFieldMapper.AbstractShapeGeometryFieldType<T>
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.AbstractGeometryFieldMapper
AbstractGeometryFieldMapper.AbstractGeometryFieldType<T>, AbstractGeometryFieldMapper.Parser<T>
Nested classes/interfaces inherited from class org.elasticsearch.index.mapper.FieldMapper
FieldMapper.Conflicts, FieldMapper.CopyTo, FieldMapper.MergeValidator<T>, FieldMapper.MultiFields, FieldMapper.Parameter<T>, FieldMapper.Serializer<T>, FieldMapper.SerializerCheck<T>, FieldMapper.TypeParser
Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
org.elasticsearch.xcontent.ToXContent.DelegatingMapParams, org.elasticsearch.xcontent.ToXContent.MapParams, org.elasticsearch.xcontent.ToXContent.Params
-
Field Summary
Fields inherited from class org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper
coerce, orientation
Fields inherited from class org.elasticsearch.index.mapper.FieldMapper
COERCE_SETTING, copyTo, hasScript, IGNORE_MALFORMED_SETTING, indexAnalyzers, mappedFieldType, multiFields, onScriptError
Fields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY_PARAMS
-
Constructor Summary
ConstructorDescriptionGeoShapeFieldMapper
(String simpleName, MappedFieldType mappedFieldType, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo, GeoShapeIndexer indexer, AbstractGeometryFieldMapper.Parser<org.elasticsearch.geometry.Geometry> parser, GeoShapeFieldMapper.Builder builder) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Returns aFieldMapper.Builder
to be used for merging and serialization Implement as follows:return new MyBuilder(simpleName()).init(this);
protected void
index
(DocumentParserContext context, org.elasticsearch.geometry.Geometry geometry) Build an index document using a parsed geometryMethods inherited from class org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper
coerce, coerceParam, orientation, orientationParam
Methods inherited from class org.elasticsearch.index.mapper.AbstractGeometryFieldMapper
ignoreMalformed, ignoreMalformedParam, ignoreZValue, ignoreZValueParam, parse, parseCreateField, parsesArrayValue
Methods inherited from class org.elasticsearch.index.mapper.FieldMapper
checkIncomingMergeType, copyTo, doValidate, doXContentBody, executeScript, hasScript, indexAnalyzers, indexScriptValues, iterator, merge, multiFields, name, notInMultiFields, toXContent, typeName, validate
Methods inherited from class org.elasticsearch.index.mapper.Mapper
simpleName
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
CONTENT_TYPE
- See Also:
-
PARSER
Deprecated.
-
-
Constructor Details
-
GeoShapeFieldMapper
public GeoShapeFieldMapper(String simpleName, MappedFieldType mappedFieldType, FieldMapper.MultiFields multiFields, FieldMapper.CopyTo copyTo, GeoShapeIndexer indexer, AbstractGeometryFieldMapper.Parser<org.elasticsearch.geometry.Geometry> parser, GeoShapeFieldMapper.Builder builder)
-
-
Method Details
-
getMergeBuilder
Description copied from class:FieldMapper
Returns aFieldMapper.Builder
to be used for merging and serialization Implement as follows:return new MyBuilder(simpleName()).init(this);
- Specified by:
getMergeBuilder
in classFieldMapper
-
index
protected void index(DocumentParserContext context, org.elasticsearch.geometry.Geometry geometry) throws IOException Description copied from class:AbstractGeometryFieldMapper
Build an index document using a parsed geometry- Specified by:
index
in classAbstractGeometryFieldMapper<org.elasticsearch.geometry.Geometry>
- Parameters:
context
- the ParseContext holding the documentgeometry
- the parsed geometry object- Throws:
IOException
-
fieldType
- Overrides:
fieldType
in classAbstractGeometryFieldMapper<org.elasticsearch.geometry.Geometry>
-
contentType
- Specified by:
contentType
in classFieldMapper
-