diff --git a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java index 58fde288cfc60..5999a3ff1e151 100644 --- a/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java +++ b/x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java @@ -91,6 +91,16 @@ public void testDefaultConfiguration() throws IOException { assertTrue(fieldType.hasDocValues()); } + public void testDefaultDocValueConfigurationOnPre7_8() throws IOException { + IndexVersion oldVersion = IndexVersionUtils.randomVersionBetween(random(), IndexVersions.V_7_0_0, IndexVersions.V_7_7_0); + DocumentMapper defaultMapper = createDocumentMapper(oldVersion, fieldMapping(this::minimalMapping)); + Mapper fieldMapper = defaultMapper.mappers().getMapper(FIELD_NAME); + assertThat(fieldMapper, instanceOf(fieldMapperClass())); + + GeoShapeWithDocValuesFieldMapper geoShapeFieldMapper = (GeoShapeWithDocValuesFieldMapper) fieldMapper; + assertFalse(geoShapeFieldMapper.fieldType().hasDocValues()); + } + /** * Test that orientation parameter correctly parses */