From 03d717dc32b526c588a60cfa7bf12c1fb5880da4 Mon Sep 17 00:00:00 2001 From: Ignacio Vera Date: Tue, 1 Oct 2019 10:52:39 +0200 Subject: [PATCH] Provide better error when updating geo_shape field mapper settings (#47281) (#47338) --- .../index/mapper/GeoShapeFieldMapper.java | 11 ++++++++++ .../mapper/LegacyGeoShapeFieldMapper.java | 11 ++++++++++ .../search/geo/GeoShapeIntegrationIT.java | 22 +++++++++++++++++++ 3 files changed, 44 insertions(+) diff --git a/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java index aa5a74c4370..a8015d35087 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/GeoShapeFieldMapper.java @@ -104,6 +104,17 @@ public class GeoShapeFieldMapper extends AbstractGeometryFieldMapper client().admin().indices() + .preparePutMapping("test").setType("geometry") + .setSource(update, XContentType.JSON).get()); + assertThat(e.getMessage(), containsString("using [BKD] strategy cannot be merged with")); + } + /** * Test that the indexed shape routing can be provided if it is required */