소스 검색

Remove unused GeoShapeFieldMapper from server (#110689)

Ignacio Vera 1 년 전
부모
커밋
7eab0e89a6
20개의 변경된 파일11개의 추가작업 그리고 703개의 파일을 삭제
  1. 1 1
      modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java
  2. 0 10
      server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoPointIT.java
  3. 0 46
      server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoShapeIT.java
  4. 0 43
      server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoShapeIT.java
  5. 7 0
      server/src/main/java/org/elasticsearch/index/mapper/AbstractGeometryFieldMapper.java
  6. 1 1
      server/src/main/java/org/elasticsearch/index/mapper/AbstractShapeGeometryFieldMapper.java
  7. 0 211
      server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java
  8. 0 229
      server/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldMapperTests.java
  9. 0 68
      server/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldTypeTests.java
  10. 1 1
      server/src/test/java/org/elasticsearch/search/geo/GeoPointShapeQueryTests.java
  11. 0 11
      server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java
  12. 0 9
      server/src/test/java/org/elasticsearch/search/vectors/ExactKnnQueryBuilderTests.java
  13. 0 8
      server/src/test/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilderTests.java
  14. 0 2
      test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java
  15. 0 9
      test/framework/src/main/java/org/elasticsearch/search/geo/BasePointShapeQueryTestCase.java
  16. 0 34
      test/framework/src/main/java/org/elasticsearch/test/TestGeoShapeFieldMapperPlugin.java
  17. 1 2
      x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSource.java
  18. 0 10
      x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapper.java
  19. 0 4
      x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java
  20. 0 4
      x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapper.java

+ 1 - 1
modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java

@@ -81,7 +81,7 @@ import java.util.stream.Collectors;
  * <p>
  * <p>
  * "field" : "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0))
  * "field" : "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0))
  *
  *
- * @deprecated use {@link org.elasticsearch.index.mapper.GeoShapeFieldMapper}
+ * @deprecated use the field mapper in the spatial module
  */
  */
 @Deprecated
 @Deprecated
 public class LegacyGeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper<ShapeBuilder<?, ?, ?>> {
 public class LegacyGeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper<ShapeBuilder<?, ?, ?>> {

+ 0 - 10
server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoPointIT.java

@@ -9,24 +9,14 @@
 package org.elasticsearch.search.geo;
 package org.elasticsearch.search.geo;
 
 
 import org.elasticsearch.index.IndexVersion;
 import org.elasticsearch.index.IndexVersion;
-import org.elasticsearch.plugins.Plugin;
-import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin;
 import org.elasticsearch.test.index.IndexVersionUtils;
 import org.elasticsearch.test.index.IndexVersionUtils;
 import org.elasticsearch.xcontent.XContentBuilder;
 import org.elasticsearch.xcontent.XContentBuilder;
 import org.elasticsearch.xcontent.XContentFactory;
 import org.elasticsearch.xcontent.XContentFactory;
 
 
 import java.io.IOException;
 import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
 
 
 public class GeoBoundingBoxQueryGeoPointIT extends GeoBoundingBoxQueryIntegTestCase {
 public class GeoBoundingBoxQueryGeoPointIT extends GeoBoundingBoxQueryIntegTestCase {
 
 
-    @SuppressWarnings("deprecation")
-    @Override
-    protected Collection<Class<? extends Plugin>> nodePlugins() {
-        return Collections.singleton(TestGeoShapeFieldMapperPlugin.class);
-    }
-
     @Override
     @Override
     public XContentBuilder getMapping() throws IOException {
     public XContentBuilder getMapping() throws IOException {
         XContentBuilder xContentBuilder = XContentFactory.jsonBuilder()
         XContentBuilder xContentBuilder = XContentFactory.jsonBuilder()

+ 0 - 46
server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoBoundingBoxQueryGeoShapeIT.java

@@ -1,46 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-package org.elasticsearch.search.geo;
-
-import org.elasticsearch.index.IndexVersion;
-import org.elasticsearch.plugins.Plugin;
-import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin;
-import org.elasticsearch.test.index.IndexVersionUtils;
-import org.elasticsearch.xcontent.XContentBuilder;
-import org.elasticsearch.xcontent.XContentFactory;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-
-public class GeoBoundingBoxQueryGeoShapeIT extends GeoBoundingBoxQueryIntegTestCase {
-
-    @SuppressWarnings("deprecation")
-    @Override
-    protected Collection<Class<? extends Plugin>> nodePlugins() {
-        return Collections.singleton(TestGeoShapeFieldMapperPlugin.class);
-    }
-
-    @Override
-    public XContentBuilder getMapping() throws IOException {
-        XContentBuilder xContentBuilder = XContentFactory.jsonBuilder()
-            .startObject()
-            .startObject("_doc")
-            .startObject("properties")
-            .startObject("location")
-            .field("type", "geo_shape");
-        xContentBuilder.endObject().endObject().endObject().endObject();
-        return xContentBuilder;
-    }
-
-    @Override
-    public IndexVersion randomSupportedVersion() {
-        return IndexVersionUtils.randomCompatibleVersion(random());
-    }
-}

+ 0 - 43
server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoShapeIT.java

@@ -1,43 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-package org.elasticsearch.search.geo;
-
-import org.elasticsearch.index.IndexVersion;
-import org.elasticsearch.plugins.Plugin;
-import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin;
-import org.elasticsearch.test.index.IndexVersionUtils;
-import org.elasticsearch.xcontent.XContentBuilder;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-
-public class GeoShapeIT extends GeoShapeIntegTestCase {
-
-    @SuppressWarnings("deprecation")
-    @Override
-    protected Collection<Class<? extends Plugin>> nodePlugins() {
-        return Collections.singleton(TestGeoShapeFieldMapperPlugin.class);
-    }
-
-    @Override
-    protected void getGeoShapeMapping(XContentBuilder b) throws IOException {
-        b.field("type", "geo_shape");
-    }
-
-    @Override
-    protected IndexVersion randomSupportedVersion() {
-        return IndexVersionUtils.randomCompatibleVersion(random());
-    }
-
-    @Override
-    protected boolean allowExpensiveQueries() {
-        return true;
-    }
-}

+ 7 - 0
server/src/main/java/org/elasticsearch/index/mapper/AbstractGeometryFieldMapper.java

@@ -11,6 +11,7 @@ import org.apache.lucene.search.Query;
 import org.elasticsearch.common.CheckedBiConsumer;
 import org.elasticsearch.common.CheckedBiConsumer;
 import org.elasticsearch.common.Explicit;
 import org.elasticsearch.common.Explicit;
 import org.elasticsearch.common.geo.GeometryFormatterFactory;
 import org.elasticsearch.common.geo.GeometryFormatterFactory;
+import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.core.CheckedConsumer;
 import org.elasticsearch.core.CheckedConsumer;
 import org.elasticsearch.index.query.SearchExecutionContext;
 import org.elasticsearch.index.query.SearchExecutionContext;
 import org.elasticsearch.xcontent.DeprecationHandler;
 import org.elasticsearch.xcontent.DeprecationHandler;
@@ -35,6 +36,12 @@ import java.util.function.Function;
  */
  */
 public abstract class AbstractGeometryFieldMapper<T> extends FieldMapper {
 public abstract class AbstractGeometryFieldMapper<T> extends FieldMapper {
 
 
+    // The GeoShapeFieldMapper class does not exist in server any more.
+    // For backwards compatibility we add the name of the class manually.
+    protected static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(
+        "org.elasticsearch.index.mapper.GeoShapeFieldMapper"
+    );
+
     public static Parameter<Explicit<Boolean>> ignoreMalformedParam(
     public static Parameter<Explicit<Boolean>> ignoreMalformedParam(
         Function<FieldMapper, Explicit<Boolean>> initializer,
         Function<FieldMapper, Explicit<Boolean>> initializer,
         boolean ignoreMalformedByDefault
         boolean ignoreMalformedByDefault

+ 1 - 1
server/src/main/java/org/elasticsearch/index/mapper/AbstractShapeGeometryFieldMapper.java

@@ -14,7 +14,7 @@ import java.util.Map;
 import java.util.function.Function;
 import java.util.function.Function;
 
 
 /**
 /**
- * Base class for {@link GeoShapeFieldMapper}
+ * Base class for shape field mappers
  */
  */
 public abstract class AbstractShapeGeometryFieldMapper<T> extends AbstractGeometryFieldMapper<T> {
 public abstract class AbstractShapeGeometryFieldMapper<T> extends AbstractGeometryFieldMapper<T> {
     @Override
     @Override

+ 0 - 211
server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java

@@ -1,211 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-package org.elasticsearch.index.mapper;
-
-import org.apache.lucene.document.LatLonShape;
-import org.apache.lucene.geo.LatLonGeometry;
-import org.apache.lucene.search.Query;
-import org.elasticsearch.common.Explicit;
-import org.elasticsearch.common.geo.GeometryFormatterFactory;
-import org.elasticsearch.common.geo.GeometryParser;
-import org.elasticsearch.common.geo.Orientation;
-import org.elasticsearch.common.geo.ShapeRelation;
-import org.elasticsearch.common.logging.DeprecationCategory;
-import org.elasticsearch.common.logging.DeprecationLogger;
-import org.elasticsearch.geometry.Geometry;
-import org.elasticsearch.index.IndexVersions;
-import org.elasticsearch.index.query.QueryShardException;
-import org.elasticsearch.index.query.SearchExecutionContext;
-
-import java.util.List;
-import java.util.Map;
-import java.util.function.Function;
-
-/**
- * FieldMapper for indexing {@link LatLonShape}s.
- * <p>
- * Currently Shapes can only be indexed and can only be queried using
- * {@link org.elasticsearch.index.query.GeoShapeQueryBuilder}, consequently
- * a lot of behavior in this Mapper is disabled.
- * <p>
- * Format supported:
- * <p>
- * "field" : {
- * "type" : "polygon",
- * "coordinates" : [
- * [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]
- * ]
- * }
- * <p>
- * or:
- * <p>
- * "field" : "POLYGON ((100.0 0.0, 101.0 0.0, 101.0 1.0, 100.0 1.0, 100.0 0.0))
- */
-public class GeoShapeFieldMapper extends AbstractShapeGeometryFieldMapper<Geometry> {
-
-    private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(GeoShapeFieldMapper.class);
-
-    public static final String CONTENT_TYPE = "geo_shape";
-
-    private static Builder builder(FieldMapper in) {
-        return ((GeoShapeFieldMapper) in).builder;
-    }
-
-    public static class Builder extends FieldMapper.Builder {
-
-        final Parameter<Boolean> indexed = Parameter.indexParam(m -> builder(m).indexed.get(), true);
-
-        final Parameter<Explicit<Boolean>> ignoreMalformed;
-        final Parameter<Explicit<Boolean>> ignoreZValue = ignoreZValueParam(m -> builder(m).ignoreZValue.get());
-        final Parameter<Explicit<Boolean>> coerce;
-        final Parameter<Explicit<Orientation>> orientation = orientationParam(m -> builder(m).orientation.get());
-
-        final Parameter<Map<String, String>> meta = Parameter.metaParam();
-
-        public Builder(String name, boolean ignoreMalformedByDefault, boolean coerceByDefault) {
-            super(name);
-            this.ignoreMalformed = ignoreMalformedParam(m -> builder(m).ignoreMalformed.get(), ignoreMalformedByDefault);
-            this.coerce = coerceParam(m -> builder(m).coerce.get(), coerceByDefault);
-        }
-
-        public Builder ignoreZValue(boolean ignoreZValue) {
-            this.ignoreZValue.setValue(Explicit.explicitBoolean(ignoreZValue));
-            return this;
-        }
-
-        @Override
-        protected Parameter<?>[] getParameters() {
-            return new Parameter<?>[] { indexed, ignoreMalformed, ignoreZValue, coerce, orientation, meta };
-        }
-
-        @Override
-        public GeoShapeFieldMapper build(MapperBuilderContext context) {
-            if (multiFieldsBuilder.hasMultiFields()) {
-                DEPRECATION_LOGGER.warn(
-                    DeprecationCategory.MAPPINGS,
-                    "geo_shape_multifields",
-                    "Adding multifields to [geo_shape] mappers has no effect and will be forbidden in future"
-                );
-            }
-            GeometryParser geometryParser = new GeometryParser(
-                orientation.get().value().getAsBoolean(),
-                coerce.get().value(),
-                ignoreZValue.get().value()
-            );
-            GeoShapeParser geoShapeParser = new GeoShapeParser(geometryParser, orientation.get().value());
-            GeoShapeFieldType ft = new GeoShapeFieldType(
-                context.buildFullName(leafName()),
-                indexed.get(),
-                orientation.get().value(),
-                geoShapeParser,
-                meta.get()
-            );
-            return new GeoShapeFieldMapper(
-                leafName(),
-                ft,
-                multiFieldsBuilder.build(this, context),
-                copyTo,
-                new GeoShapeIndexer(orientation.get().value(), context.buildFullName(leafName())),
-                geoShapeParser,
-                this
-            );
-        }
-    }
-
-    public static class GeoShapeFieldType extends AbstractShapeGeometryFieldType<Geometry> implements GeoShapeQueryable {
-
-        public GeoShapeFieldType(String name, boolean indexed, Orientation orientation, Parser<Geometry> parser, Map<String, String> meta) {
-            super(name, indexed, false, false, parser, orientation, meta);
-        }
-
-        @Override
-        public String typeName() {
-            return CONTENT_TYPE;
-        }
-
-        @Override
-        public Query geoShapeQuery(SearchExecutionContext context, String fieldName, ShapeRelation relation, LatLonGeometry... geometries) {
-            // CONTAINS queries are not supported by VECTOR strategy for indices created before version 7.5.0 (Lucene 8.3.0)
-            if (relation == ShapeRelation.CONTAINS && context.indexVersionCreated().before(IndexVersions.V_7_5_0)) {
-                throw new QueryShardException(
-                    context,
-                    ShapeRelation.CONTAINS + " query relation not supported for Field [" + fieldName + "]."
-                );
-            }
-            return LatLonShape.newGeometryQuery(fieldName, relation.getLuceneRelation(), geometries);
-        }
-
-        @Override
-        protected Function<List<Geometry>, List<Object>> getFormatter(String format) {
-            return GeometryFormatterFactory.getFormatter(format, Function.identity());
-        }
-    }
-
-    @Deprecated
-    public static Mapper.TypeParser PARSER = (name, node, parserContext) -> {
-        boolean ignoreMalformedByDefault = IGNORE_MALFORMED_SETTING.get(parserContext.getSettings());
-        boolean coerceByDefault = COERCE_SETTING.get(parserContext.getSettings());
-        FieldMapper.Builder builder = new Builder(name, ignoreMalformedByDefault, coerceByDefault);
-        builder.parse(name, parserContext, node);
-        return builder;
-    };
-
-    private final Builder builder;
-    private final GeoShapeIndexer indexer;
-
-    public GeoShapeFieldMapper(
-        String simpleName,
-        MappedFieldType mappedFieldType,
-        MultiFields multiFields,
-        CopyTo copyTo,
-        GeoShapeIndexer indexer,
-        Parser<Geometry> parser,
-        Builder builder
-    ) {
-        super(
-            simpleName,
-            mappedFieldType,
-            builder.ignoreMalformed.get(),
-            builder.coerce.get(),
-            builder.ignoreZValue.get(),
-            builder.orientation.get(),
-            multiFields,
-            copyTo,
-            parser
-        );
-        this.builder = builder;
-        this.indexer = indexer;
-    }
-
-    @Override
-    public FieldMapper.Builder getMergeBuilder() {
-        return new Builder(leafName(), builder.ignoreMalformed.getDefaultValue().value(), builder.coerce.getDefaultValue().value()).init(
-            this
-        );
-    }
-
-    @Override
-    protected void index(DocumentParserContext context, Geometry geometry) {
-        if (geometry == null) {
-            return;
-        }
-        context.doc().addAll(indexer.indexShape(geometry));
-        context.addToFieldNames(fieldType().name());
-    }
-
-    @Override
-    public GeoShapeFieldType fieldType() {
-        return (GeoShapeFieldType) super.fieldType();
-    }
-
-    @Override
-    protected String contentType() {
-        return CONTENT_TYPE;
-    }
-
-}

+ 0 - 229
server/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldMapperTests.java

@@ -1,229 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-package org.elasticsearch.index.mapper;
-
-import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.geo.Orientation;
-import org.elasticsearch.plugins.Plugin;
-import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin;
-import org.elasticsearch.xcontent.ToXContent;
-import org.elasticsearch.xcontent.XContentBuilder;
-import org.junit.AssumptionViolatedException;
-
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-
-import static org.hamcrest.Matchers.containsString;
-import static org.hamcrest.Matchers.equalTo;
-import static org.hamcrest.Matchers.hasSize;
-import static org.hamcrest.Matchers.instanceOf;
-
-public class GeoShapeFieldMapperTests extends MapperTestCase {
-
-    @Override
-    protected void registerParameters(ParameterChecker checker) throws IOException {
-        checker.registerUpdateCheck(b -> b.field("orientation", "right"), m -> {
-            GeoShapeFieldMapper gsfm = (GeoShapeFieldMapper) m;
-            assertEquals(Orientation.RIGHT, gsfm.orientation());
-        });
-        checker.registerUpdateCheck(b -> b.field("ignore_z_value", false), m -> {
-            GeoShapeFieldMapper gpfm = (GeoShapeFieldMapper) m;
-            assertFalse(gpfm.ignoreZValue());
-        });
-        checker.registerUpdateCheck(b -> b.field("coerce", true), m -> {
-            GeoShapeFieldMapper gpfm = (GeoShapeFieldMapper) m;
-            assertTrue(gpfm.coerce.value());
-        });
-    }
-
-    @Override
-    protected Collection<? extends Plugin> getPlugins() {
-        return List.of(new TestGeoShapeFieldMapperPlugin());
-    }
-
-    @Override
-    protected void minimalMapping(XContentBuilder b) throws IOException {
-        b.field("type", "geo_shape");
-    }
-
-    @Override
-    protected boolean supportsStoredFields() {
-        return false;
-    }
-
-    @Override
-    protected Object getSampleValueForDocument() {
-        return "POINT (14.0 15.0)";
-    }
-
-    public void testDefaultConfiguration() throws IOException {
-        DocumentMapper mapper = createDocumentMapper(fieldMapping(this::minimalMapping));
-        Mapper fieldMapper = mapper.mappers().getMapper("field");
-        assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class));
-        GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper;
-        assertThat(geoShapeFieldMapper.fieldType().orientation(), equalTo(Orientation.RIGHT));
-        assertThat(geoShapeFieldMapper.fieldType().hasDocValues(), equalTo(false));
-    }
-
-    /**
-     * Test that orientation parameter correctly parses
-     */
-    public void testOrientationParsing() throws IOException {
-        DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "geo_shape").field("orientation", "left")));
-        Mapper fieldMapper = mapper.mappers().getMapper("field");
-        assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class));
-
-        Orientation orientation = ((GeoShapeFieldMapper) fieldMapper).fieldType().orientation();
-        assertThat(orientation, equalTo(Orientation.CLOCKWISE));
-        assertThat(orientation, equalTo(Orientation.LEFT));
-        assertThat(orientation, equalTo(Orientation.CW));
-
-        // explicit right orientation test
-        mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "geo_shape").field("orientation", "right")));
-        fieldMapper = mapper.mappers().getMapper("field");
-        assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class));
-
-        orientation = ((GeoShapeFieldMapper) fieldMapper).fieldType().orientation();
-        assertThat(orientation, equalTo(Orientation.COUNTER_CLOCKWISE));
-        assertThat(orientation, equalTo(Orientation.RIGHT));
-        assertThat(orientation, equalTo(Orientation.CCW));
-    }
-
-    /**
-     * Test that coerce parameter correctly parses
-     */
-    public void testCoerceParsing() throws IOException {
-        DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "geo_shape").field("coerce", true)));
-        Mapper fieldMapper = mapper.mappers().getMapper("field");
-        assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class));
-        boolean coerce = ((GeoShapeFieldMapper) fieldMapper).coerce();
-        assertThat(coerce, equalTo(true));
-
-        // explicit false coerce test
-        mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "geo_shape").field("coerce", false)));
-        fieldMapper = mapper.mappers().getMapper("field");
-        assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class));
-        coerce = ((GeoShapeFieldMapper) fieldMapper).coerce();
-        assertThat(coerce, equalTo(false));
-    }
-
-    /**
-     * Test that accept_z_value parameter correctly parses
-     */
-    public void testIgnoreZValue() throws IOException {
-        DocumentMapper mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "geo_shape").field("ignore_z_value", true)));
-        Mapper fieldMapper = mapper.mappers().getMapper("field");
-        assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class));
-
-        boolean ignoreZValue = ((GeoShapeFieldMapper) fieldMapper).ignoreZValue();
-        assertThat(ignoreZValue, equalTo(true));
-
-        // explicit false accept_z_value test
-        mapper = createDocumentMapper(fieldMapping(b -> b.field("type", "geo_shape").field("ignore_z_value", false)));
-        fieldMapper = mapper.mappers().getMapper("field");
-        assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class));
-
-        ignoreZValue = ((GeoShapeFieldMapper) fieldMapper).ignoreZValue();
-        assertThat(ignoreZValue, equalTo(false));
-    }
-
-    @Override
-    protected boolean supportsIgnoreMalformed() {
-        return true;
-    }
-
-    @Override
-    protected List<ExampleMalformedValue> exampleMalformedValues() {
-        return List.of(
-            exampleMalformedValue("Bad shape").errorMatches("Unknown geometry type: bad"),
-            exampleMalformedValue(
-                "POLYGON ((18.9401790919516 -33.9681188869036, 18.9401790919516 -33.9681188869036, 18.9401790919517 "
-                    + "-33.9681188869036, 18.9401790919517 -33.9681188869036, 18.9401790919516 -33.9681188869036))"
-            ).errorMatches("at least three non-collinear points required")
-        );
-    }
-
-    public void testGeoShapeMapperMerge() throws Exception {
-        MapperService mapperService = createMapperService(fieldMapping(b -> b.field("type", "geo_shape").field("orientation", "ccw")));
-        Mapper fieldMapper = mapperService.documentMapper().mappers().getMapper("field");
-        assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class));
-        GeoShapeFieldMapper geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper;
-        assertThat(geoShapeFieldMapper.fieldType().orientation(), equalTo(Orientation.CCW));
-
-        // change mapping; orientation
-        merge(mapperService, fieldMapping(b -> b.field("type", "geo_shape").field("orientation", "cw")));
-        fieldMapper = mapperService.documentMapper().mappers().getMapper("field");
-        assertThat(fieldMapper, instanceOf(GeoShapeFieldMapper.class));
-        geoShapeFieldMapper = (GeoShapeFieldMapper) fieldMapper;
-        assertThat(geoShapeFieldMapper.fieldType().orientation(), equalTo(Orientation.CW));
-    }
-
-    public void testSerializeDefaults() throws Exception {
-        DocumentMapper mapper = createDocumentMapper(fieldMapping(this::minimalMapping));
-        assertThat(
-            Strings.toString(
-                mapper.mappers().getMapper("field"),
-                new ToXContent.MapParams(Collections.singletonMap("include_defaults", "true"))
-            ),
-            containsString("\"orientation\":\"" + Orientation.RIGHT + "\"")
-        );
-    }
-
-    public void testGeoShapeArrayParsing() throws Exception {
-        DocumentMapper mapper = createDocumentMapper(fieldMapping(this::minimalMapping));
-        ParsedDocument document = mapper.parse(source(b -> {
-            b.startArray("field");
-            {
-                b.startObject().field("type", "Point").startArray("coordinates").value(176.0).value(15.0).endArray().endObject();
-                b.startObject().field("type", "Point").startArray("coordinates").value(76.0).value(-15.0).endArray().endObject();
-            }
-            b.endArray();
-        }));
-        assertThat(document.docs(), hasSize(1));
-        assertThat(document.docs().get(0).getFields("field"), hasSize(2));
-    }
-
-    public void testMultiFieldsDeprecationWarning() throws Exception {
-        createDocumentMapper(fieldMapping(b -> {
-            minimalMapping(b);
-            b.startObject("fields");
-            b.startObject("keyword").field("type", "keyword").endObject();
-            b.endObject();
-        }));
-        assertWarnings("Adding multifields to [geo_shape] mappers has no effect and will be forbidden in future");
-    }
-
-    @Override
-    protected boolean supportsMeta() {
-        return false;
-    }
-
-    protected void assertSearchable(MappedFieldType fieldType) {
-        // always searchable even if it uses TextSearchInfo.NONE
-        assertTrue(fieldType.isIndexed());
-        assertTrue(fieldType.isSearchable());
-    }
-
-    @Override
-    protected Object generateRandomInputValue(MappedFieldType ft) {
-        assumeFalse("Test implemented in a follow up", true);
-        return null;
-    }
-
-    @Override
-    protected SyntheticSourceSupport syntheticSourceSupport(boolean ignoreMalformed) {
-        throw new AssumptionViolatedException("not supported");
-    }
-
-    @Override
-    protected IngestScriptSupport ingestScriptSupport() {
-        throw new AssumptionViolatedException("not supported");
-    }
-}

+ 0 - 68
server/src/test/java/org/elasticsearch/index/mapper/GeoShapeFieldTypeTests.java

@@ -1,68 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-package org.elasticsearch.index.mapper;
-
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-public class GeoShapeFieldTypeTests extends FieldTypeTestCase {
-
-    public void testFetchSourceValue() throws IOException {
-        MappedFieldType mapper = new GeoShapeFieldMapper.Builder("field", true, true).build(MapperBuilderContext.root(false, false))
-            .fieldType();
-
-        Map<String, Object> jsonLineString = Map.of("type", "LineString", "coordinates", List.of(List.of(42.0, 27.1), List.of(30.0, 50.0)));
-        Map<String, Object> jsonPoint = Map.of("type", "Point", "coordinates", List.of(14.0, 15.0));
-        Map<String, Object> jsonMalformed = Map.of("type", "Point", "coordinates", "foo");
-        String wktLineString = "LINESTRING (42.0 27.1, 30.0 50.0)";
-        String wktPoint = "POINT (14.0 15.0)";
-        String wktMalformed = "POINT foo";
-
-        // Test a single shape in geojson format.
-        Object sourceValue = jsonLineString;
-        assertEquals(List.of(jsonLineString), fetchSourceValue(mapper, sourceValue, null));
-        assertEquals(List.of(wktLineString), fetchSourceValue(mapper, sourceValue, "wkt"));
-
-        // Test a malformed single shape in geojson format
-        sourceValue = jsonMalformed;
-        assertEquals(List.of(), fetchSourceValue(mapper, sourceValue, null));
-        assertEquals(List.of(), fetchSourceValue(mapper, sourceValue, "wkt"));
-
-        // Test a list of shapes in geojson format.
-        sourceValue = List.of(jsonLineString, jsonPoint);
-        assertEquals(List.of(jsonLineString, jsonPoint), fetchSourceValue(mapper, sourceValue, null));
-        assertEquals(List.of(wktLineString, wktPoint), fetchSourceValue(mapper, sourceValue, "wkt"));
-
-        // Test a list of shapes including one malformed in geojson format
-        sourceValue = List.of(jsonLineString, jsonMalformed, jsonPoint);
-        assertEquals(List.of(jsonLineString, jsonPoint), fetchSourceValue(mapper, sourceValue, null));
-        assertEquals(List.of(wktLineString, wktPoint), fetchSourceValue(mapper, sourceValue, "wkt"));
-
-        // Test a single shape in wkt format.
-        sourceValue = wktLineString;
-        assertEquals(List.of(jsonLineString), fetchSourceValue(mapper, sourceValue, null));
-        assertEquals(List.of(wktLineString), fetchSourceValue(mapper, sourceValue, "wkt"));
-
-        // Test a single malformed shape in wkt format
-        sourceValue = wktMalformed;
-        assertEquals(List.of(), fetchSourceValue(mapper, sourceValue, null));
-        assertEquals(List.of(), fetchSourceValue(mapper, sourceValue, "wkt"));
-
-        // Test a list of shapes in wkt format.
-        sourceValue = List.of(wktLineString, wktPoint);
-        assertEquals(List.of(jsonLineString, jsonPoint), fetchSourceValue(mapper, sourceValue, null));
-        assertEquals(List.of(wktLineString, wktPoint), fetchSourceValue(mapper, sourceValue, "wkt"));
-
-        // Test a list of shapes including one malformed in wkt format
-        sourceValue = List.of(wktLineString, wktMalformed, wktPoint);
-        assertEquals(List.of(jsonLineString, jsonPoint), fetchSourceValue(mapper, sourceValue, null));
-        assertEquals(List.of(wktLineString, wktPoint), fetchSourceValue(mapper, sourceValue, "wkt"));
-    }
-}

+ 1 - 1
server/src/test/java/org/elasticsearch/search/geo/GeoPointShapeQueryTests.java

@@ -37,7 +37,7 @@ public class GeoPointShapeQueryTests extends BasePointShapeQueryTestCase<GeoShap
 
 
     @Override
     @Override
     protected String fieldTypeName() {
     protected String fieldTypeName() {
-        return "geo_shape";
+        return "keyword";
     }
     }
 
 
     @Override
     @Override

+ 0 - 11
server/src/test/java/org/elasticsearch/search/geo/GeoShapeQueryTests.java

@@ -1,11 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-
-package org.elasticsearch.search.geo;
-
-public class GeoShapeQueryTests extends GeoShapeQueryTestCase {}

+ 0 - 9
server/src/test/java/org/elasticsearch/search/vectors/ExactKnnQueryBuilderTests.java

@@ -16,16 +16,12 @@ import org.elasticsearch.index.IndexVersions;
 import org.elasticsearch.index.mapper.MapperService;
 import org.elasticsearch.index.mapper.MapperService;
 import org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper;
 import org.elasticsearch.index.mapper.vectors.DenseVectorFieldMapper;
 import org.elasticsearch.index.query.SearchExecutionContext;
 import org.elasticsearch.index.query.SearchExecutionContext;
-import org.elasticsearch.plugins.Plugin;
 import org.elasticsearch.test.AbstractQueryTestCase;
 import org.elasticsearch.test.AbstractQueryTestCase;
-import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin;
 import org.elasticsearch.xcontent.XContentBuilder;
 import org.elasticsearch.xcontent.XContentBuilder;
 import org.elasticsearch.xcontent.XContentFactory;
 import org.elasticsearch.xcontent.XContentFactory;
 
 
 import java.io.IOException;
 import java.io.IOException;
 import java.util.Arrays;
 import java.util.Arrays;
-import java.util.Collection;
-import java.util.List;
 
 
 public class ExactKnnQueryBuilderTests extends AbstractQueryTestCase<ExactKnnQueryBuilder> {
 public class ExactKnnQueryBuilderTests extends AbstractQueryTestCase<ExactKnnQueryBuilder> {
 
 
@@ -51,11 +47,6 @@ public class ExactKnnQueryBuilderTests extends AbstractQueryTestCase<ExactKnnQue
         );
         );
     }
     }
 
 
-    @Override
-    protected Collection<Class<? extends Plugin>> getPlugins() {
-        return List.of(TestGeoShapeFieldMapperPlugin.class);
-    }
-
     @Override
     @Override
     protected ExactKnnQueryBuilder doCreateTestQueryBuilder() {
     protected ExactKnnQueryBuilder doCreateTestQueryBuilder() {
         float[] query = new float[VECTOR_DIMENSION];
         float[] query = new float[VECTOR_DIMENSION];

+ 0 - 8
server/src/test/java/org/elasticsearch/search/vectors/KnnScoreDocQueryBuilderTests.java

@@ -28,14 +28,11 @@ import org.elasticsearch.index.query.MatchNoneQueryBuilder;
 import org.elasticsearch.index.query.QueryBuilder;
 import org.elasticsearch.index.query.QueryBuilder;
 import org.elasticsearch.index.query.QueryRewriteContext;
 import org.elasticsearch.index.query.QueryRewriteContext;
 import org.elasticsearch.index.query.SearchExecutionContext;
 import org.elasticsearch.index.query.SearchExecutionContext;
-import org.elasticsearch.plugins.Plugin;
 import org.elasticsearch.test.AbstractQueryTestCase;
 import org.elasticsearch.test.AbstractQueryTestCase;
-import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin;
 
 
 import java.io.IOException;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Arrays;
-import java.util.Collection;
 import java.util.Comparator;
 import java.util.Comparator;
 import java.util.List;
 import java.util.List;
 
 
@@ -49,11 +46,6 @@ import static org.hamcrest.Matchers.nullValue;
 
 
 public class KnnScoreDocQueryBuilderTests extends AbstractQueryTestCase<KnnScoreDocQueryBuilder> {
 public class KnnScoreDocQueryBuilderTests extends AbstractQueryTestCase<KnnScoreDocQueryBuilder> {
 
 
-    @Override
-    protected Collection<Class<? extends Plugin>> getPlugins() {
-        return List.of(TestGeoShapeFieldMapperPlugin.class);
-    }
-
     @Override
     @Override
     protected KnnScoreDocQueryBuilder doCreateTestQueryBuilder() {
     protected KnnScoreDocQueryBuilder doCreateTestQueryBuilder() {
         List<ScoreDoc> scoreDocs = new ArrayList<>();
         List<ScoreDoc> scoreDocs = new ArrayList<>();

+ 0 - 2
test/framework/src/main/java/org/elasticsearch/search/aggregations/AggregatorTestCase.java

@@ -89,7 +89,6 @@ import org.elasticsearch.index.mapper.DateFieldMapper;
 import org.elasticsearch.index.mapper.FieldAliasMapper;
 import org.elasticsearch.index.mapper.FieldAliasMapper;
 import org.elasticsearch.index.mapper.FieldMapper;
 import org.elasticsearch.index.mapper.FieldMapper;
 import org.elasticsearch.index.mapper.GeoPointFieldMapper;
 import org.elasticsearch.index.mapper.GeoPointFieldMapper;
-import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
 import org.elasticsearch.index.mapper.IdLoader;
 import org.elasticsearch.index.mapper.IdLoader;
 import org.elasticsearch.index.mapper.KeywordFieldMapper;
 import org.elasticsearch.index.mapper.KeywordFieldMapper;
 import org.elasticsearch.index.mapper.MappedFieldType;
 import org.elasticsearch.index.mapper.MappedFieldType;
@@ -198,7 +197,6 @@ public abstract class AggregatorTestCase extends ESTestCase {
     // A list of field types that should not be tested, or are not currently supported
     // A list of field types that should not be tested, or are not currently supported
     private static final List<String> TYPE_TEST_BLACKLIST = List.of(
     private static final List<String> TYPE_TEST_BLACKLIST = List.of(
         ObjectMapper.CONTENT_TYPE, // Cannot aggregate objects
         ObjectMapper.CONTENT_TYPE, // Cannot aggregate objects
-        GeoShapeFieldMapper.CONTENT_TYPE, // Cannot aggregate geoshapes (yet)
         DenseVectorFieldMapper.CONTENT_TYPE, // Cannot aggregate dense vectors
         DenseVectorFieldMapper.CONTENT_TYPE, // Cannot aggregate dense vectors
         SparseVectorFieldMapper.CONTENT_TYPE, // Sparse vectors are no longer supported
         SparseVectorFieldMapper.CONTENT_TYPE, // Sparse vectors are no longer supported
 
 

+ 0 - 9
test/framework/src/main/java/org/elasticsearch/search/geo/BasePointShapeQueryTestCase.java

@@ -32,16 +32,12 @@ import org.elasticsearch.geometry.Rectangle;
 import org.elasticsearch.geometry.ShapeType;
 import org.elasticsearch.geometry.ShapeType;
 import org.elasticsearch.geometry.utils.WellKnownText;
 import org.elasticsearch.geometry.utils.WellKnownText;
 import org.elasticsearch.index.query.AbstractGeometryQueryBuilder;
 import org.elasticsearch.index.query.AbstractGeometryQueryBuilder;
-import org.elasticsearch.plugins.Plugin;
 import org.elasticsearch.search.SearchHits;
 import org.elasticsearch.search.SearchHits;
 import org.elasticsearch.test.ESSingleNodeTestCase;
 import org.elasticsearch.test.ESSingleNodeTestCase;
-import org.elasticsearch.test.TestGeoShapeFieldMapperPlugin;
 import org.elasticsearch.xcontent.XContentFactory;
 import org.elasticsearch.xcontent.XContentFactory;
 import org.elasticsearch.xcontent.XContentType;
 import org.elasticsearch.xcontent.XContentType;
 import org.hamcrest.CoreMatchers;
 import org.hamcrest.CoreMatchers;
 
 
-import java.util.Collection;
-import java.util.Collections;
 import java.util.List;
 import java.util.List;
 import java.util.Map;
 import java.util.Map;
 
 
@@ -67,11 +63,6 @@ public abstract class BasePointShapeQueryTestCase<T extends AbstractGeometryQuer
 
 
     protected abstract String fieldTypeName();
     protected abstract String fieldTypeName();
 
 
-    @Override
-    protected Collection<Class<? extends Plugin>> getPlugins() {
-        return Collections.singleton(TestGeoShapeFieldMapperPlugin.class);
-    }
-
     protected abstract void createMapping(String indexName, String fieldName, Settings settings) throws Exception;
     protected abstract void createMapping(String indexName, String fieldName, Settings settings) throws Exception;
 
 
     protected void createMapping(String indexName, String fieldName) throws Exception {
     protected void createMapping(String indexName, String fieldName) throws Exception {

+ 0 - 34
test/framework/src/main/java/org/elasticsearch/test/TestGeoShapeFieldMapperPlugin.java

@@ -1,34 +0,0 @@
-/*
- * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
- * or more contributor license agreements. Licensed under the Elastic License
- * 2.0 and the Server Side Public License, v 1; you may not use this file except
- * in compliance with, at your election, the Elastic License 2.0 or the Server
- * Side Public License, v 1.
- */
-package org.elasticsearch.test;
-
-import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
-import org.elasticsearch.index.mapper.Mapper;
-import org.elasticsearch.plugins.MapperPlugin;
-import org.elasticsearch.plugins.Plugin;
-
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * Some tests depend on the {@link org.elasticsearch.index.mapper.GeoShapeFieldMapper}.
- * This mapper is registered in the spatial-extras module, but used in many integration
- * tests in server code. The goal is to migrate all of the spatial/geo pieces to the spatial-extras
- * module such that no tests in server depend on this test plugin
- */
-@Deprecated
-public class TestGeoShapeFieldMapperPlugin extends Plugin implements MapperPlugin {
-
-    @Override
-    public Map<String, Mapper.TypeParser> getMappers() {
-        Map<String, Mapper.TypeParser> mappers = new LinkedHashMap<>();
-        mappers.put(GeoShapeFieldMapper.CONTENT_TYPE, GeoShapeFieldMapper.PARSER);
-        return Collections.unmodifiableMap(mappers);
-    }
-}

+ 1 - 2
x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/pivot/GeoTileGroupSource.java

@@ -10,7 +10,6 @@ package org.elasticsearch.xpack.core.transform.transforms.pivot;
 import org.elasticsearch.common.geo.GeoBoundingBox;
 import org.elasticsearch.common.geo.GeoBoundingBox;
 import org.elasticsearch.common.io.stream.StreamInput;
 import org.elasticsearch.common.io.stream.StreamInput;
 import org.elasticsearch.common.io.stream.StreamOutput;
 import org.elasticsearch.common.io.stream.StreamOutput;
-import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
 import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils;
 import org.elasticsearch.search.aggregations.bucket.geogrid.GeoTileUtils;
 import org.elasticsearch.xcontent.ConstructingObjectParser;
 import org.elasticsearch.xcontent.ConstructingObjectParser;
 import org.elasticsearch.xcontent.ObjectParser;
 import org.elasticsearch.xcontent.ObjectParser;
@@ -138,7 +137,7 @@ public class GeoTileGroupSource extends SingleGroupSource {
 
 
     @Override
     @Override
     public String getMappingType() {
     public String getMappingType() {
-        return GeoShapeFieldMapper.CONTENT_TYPE;
+        return "geo_shape";
     }
     }
 
 
 }
 }

+ 0 - 10
x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapper.java

@@ -24,7 +24,6 @@ import org.elasticsearch.common.geo.GeometryParser;
 import org.elasticsearch.common.geo.Orientation;
 import org.elasticsearch.common.geo.Orientation;
 import org.elasticsearch.common.geo.ShapeRelation;
 import org.elasticsearch.common.geo.ShapeRelation;
 import org.elasticsearch.common.logging.DeprecationCategory;
 import org.elasticsearch.common.logging.DeprecationCategory;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.geometry.Geometry;
 import org.elasticsearch.geometry.Geometry;
 import org.elasticsearch.geometry.utils.GeometryValidator;
 import org.elasticsearch.geometry.utils.GeometryValidator;
 import org.elasticsearch.geometry.utils.WellKnownBinary;
 import org.elasticsearch.geometry.utils.WellKnownBinary;
@@ -36,7 +35,6 @@ import org.elasticsearch.index.fielddata.ScriptDocValues;
 import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper;
 import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper;
 import org.elasticsearch.index.mapper.DocumentParserContext;
 import org.elasticsearch.index.mapper.DocumentParserContext;
 import org.elasticsearch.index.mapper.FieldMapper;
 import org.elasticsearch.index.mapper.FieldMapper;
-import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
 import org.elasticsearch.index.mapper.GeoShapeIndexer;
 import org.elasticsearch.index.mapper.GeoShapeIndexer;
 import org.elasticsearch.index.mapper.GeoShapeParser;
 import org.elasticsearch.index.mapper.GeoShapeParser;
 import org.elasticsearch.index.mapper.GeoShapeQueryable;
 import org.elasticsearch.index.mapper.GeoShapeQueryable;
@@ -80,14 +78,8 @@ import java.util.Set;
 import java.util.function.Function;
 import java.util.function.Function;
 
 
 /**
 /**
- * Extension of {@link org.elasticsearch.index.mapper.GeoShapeFieldMapper} that supports docValues
- *
  * FieldMapper for indexing {@link LatLonShape}s.
  * FieldMapper for indexing {@link LatLonShape}s.
  * <p>
  * <p>
- * Currently Shapes can only be indexed and can only be queried using
- * {@link org.elasticsearch.index.query.GeoShapeQueryBuilder}, consequently
- * a lot of behavior in this Mapper is disabled.
- * <p>
  * Format supported:
  * Format supported:
  * <p>
  * <p>
  * "field" : {
  * "field" : {
@@ -104,8 +96,6 @@ import java.util.function.Function;
 public class GeoShapeWithDocValuesFieldMapper extends AbstractShapeGeometryFieldMapper<Geometry> {
 public class GeoShapeWithDocValuesFieldMapper extends AbstractShapeGeometryFieldMapper<Geometry> {
     public static final String CONTENT_TYPE = "geo_shape";
     public static final String CONTENT_TYPE = "geo_shape";
 
 
-    private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(GeoShapeFieldMapper.class);
-
     private static Builder builder(FieldMapper in) {
     private static Builder builder(FieldMapper in) {
         return ((GeoShapeWithDocValuesFieldMapper) in).builder;
         return ((GeoShapeWithDocValuesFieldMapper) in).builder;
     }
     }

+ 0 - 4
x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java

@@ -14,7 +14,6 @@ import org.elasticsearch.common.Explicit;
 import org.elasticsearch.common.geo.GeometryFormatterFactory;
 import org.elasticsearch.common.geo.GeometryFormatterFactory;
 import org.elasticsearch.common.geo.ShapeRelation;
 import org.elasticsearch.common.geo.ShapeRelation;
 import org.elasticsearch.common.logging.DeprecationCategory;
 import org.elasticsearch.common.logging.DeprecationCategory;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.core.CheckedFunction;
 import org.elasticsearch.core.CheckedFunction;
 import org.elasticsearch.geometry.Geometry;
 import org.elasticsearch.geometry.Geometry;
 import org.elasticsearch.geometry.Point;
 import org.elasticsearch.geometry.Point;
@@ -23,7 +22,6 @@ import org.elasticsearch.index.fielddata.IndexFieldData;
 import org.elasticsearch.index.mapper.AbstractPointGeometryFieldMapper;
 import org.elasticsearch.index.mapper.AbstractPointGeometryFieldMapper;
 import org.elasticsearch.index.mapper.DocumentParserContext;
 import org.elasticsearch.index.mapper.DocumentParserContext;
 import org.elasticsearch.index.mapper.FieldMapper;
 import org.elasticsearch.index.mapper.FieldMapper;
-import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
 import org.elasticsearch.index.mapper.MappedFieldType;
 import org.elasticsearch.index.mapper.MappedFieldType;
 import org.elasticsearch.index.mapper.MapperBuilderContext;
 import org.elasticsearch.index.mapper.MapperBuilderContext;
 import org.elasticsearch.index.query.SearchExecutionContext;
 import org.elasticsearch.index.query.SearchExecutionContext;
@@ -49,8 +47,6 @@ import java.util.function.Function;
 public class PointFieldMapper extends AbstractPointGeometryFieldMapper<CartesianPoint> {
 public class PointFieldMapper extends AbstractPointGeometryFieldMapper<CartesianPoint> {
     public static final String CONTENT_TYPE = "point";
     public static final String CONTENT_TYPE = "point";
 
 
-    private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(GeoShapeFieldMapper.class);
-
     private static Builder builder(FieldMapper in) {
     private static Builder builder(FieldMapper in) {
         return ((PointFieldMapper) in).builder;
         return ((PointFieldMapper) in).builder;
     }
     }

+ 0 - 4
x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapper.java

@@ -15,7 +15,6 @@ import org.elasticsearch.common.geo.GeometryParser;
 import org.elasticsearch.common.geo.Orientation;
 import org.elasticsearch.common.geo.Orientation;
 import org.elasticsearch.common.geo.ShapeRelation;
 import org.elasticsearch.common.geo.ShapeRelation;
 import org.elasticsearch.common.logging.DeprecationCategory;
 import org.elasticsearch.common.logging.DeprecationCategory;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.geometry.Geometry;
 import org.elasticsearch.geometry.Geometry;
 import org.elasticsearch.index.IndexVersion;
 import org.elasticsearch.index.IndexVersion;
 import org.elasticsearch.index.IndexVersions;
 import org.elasticsearch.index.IndexVersions;
@@ -25,7 +24,6 @@ import org.elasticsearch.index.fielddata.ScriptDocValues;
 import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper;
 import org.elasticsearch.index.mapper.AbstractShapeGeometryFieldMapper;
 import org.elasticsearch.index.mapper.DocumentParserContext;
 import org.elasticsearch.index.mapper.DocumentParserContext;
 import org.elasticsearch.index.mapper.FieldMapper;
 import org.elasticsearch.index.mapper.FieldMapper;
-import org.elasticsearch.index.mapper.GeoShapeFieldMapper;
 import org.elasticsearch.index.mapper.MappedFieldType;
 import org.elasticsearch.index.mapper.MappedFieldType;
 import org.elasticsearch.index.mapper.MapperBuilderContext;
 import org.elasticsearch.index.mapper.MapperBuilderContext;
 import org.elasticsearch.index.query.SearchExecutionContext;
 import org.elasticsearch.index.query.SearchExecutionContext;
@@ -70,8 +68,6 @@ import java.util.function.Function;
 public class ShapeFieldMapper extends AbstractShapeGeometryFieldMapper<Geometry> {
 public class ShapeFieldMapper extends AbstractShapeGeometryFieldMapper<Geometry> {
     public static final String CONTENT_TYPE = "shape";
     public static final String CONTENT_TYPE = "shape";
 
 
-    private static final DeprecationLogger DEPRECATION_LOGGER = DeprecationLogger.getLogger(GeoShapeFieldMapper.class);
-
     private static Builder builder(FieldMapper in) {
     private static Builder builder(FieldMapper in) {
         return ((ShapeFieldMapper) in).builder;
         return ((ShapeFieldMapper) in).builder;
     }
     }