Skip to content

Commit bb67a7c

Browse files
authored
GEO: Comment that we are not removing warning (#121459)
Change the warning message when you send a multifield under a geo field. We *still* ignore the multifields but we do not plan to remove them. It isn't worth breaking anyone.
1 parent 623a6af commit bb67a7c

File tree

6 files changed

+18
-6
lines changed

6 files changed

+18
-6
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,14 @@ private FieldValues<Geometry> scriptValues() {
172172
@Override
173173
public GeoShapeWithDocValuesFieldMapper build(MapperBuilderContext context) {
174174
if (multiFieldsBuilder.hasMultiFields()) {
175+
/*
176+
* We have no plans to fail on multifields because it isn't worth breaking
177+
* even the tiny fraction of users.
178+
*/
175179
DEPRECATION_LOGGER.warn(
176180
DeprecationCategory.MAPPINGS,
177181
"geo_shape_multifields",
178-
"Adding multifields to [geo_shape] mappers has no effect and will be forbidden in future"
182+
"Adding multifields to [geo_shape] mappers has no effect"
179183
);
180184
}
181185
GeometryParser geometryParser = new GeometryParser(

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,10 +100,14 @@ private static CartesianPoint parseNullValue(Object nullValue, boolean ignoreZVa
100100
@Override
101101
public FieldMapper build(MapperBuilderContext context) {
102102
if (multiFieldsBuilder.hasMultiFields()) {
103+
/*
104+
* We have no plans to fail on multifields because it isn't worth breaking
105+
* even the tiny fraction of users.
106+
*/
103107
DEPRECATION_LOGGER.warn(
104108
DeprecationCategory.MAPPINGS,
105109
"point_multifields",
106-
"Adding multifields to [point] mappers has no effect and will be forbidden in future"
110+
"Adding multifields to [point] mappers has no effect"
107111
);
108112
}
109113
CartesianPointParser parser = new CartesianPointParser(

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,14 @@ protected Parameter<?>[] getParameters() {
104104
@Override
105105
public ShapeFieldMapper build(MapperBuilderContext context) {
106106
if (multiFieldsBuilder.hasMultiFields()) {
107+
/*
108+
* We have no plans to fail on multifields because it isn't worth breaking
109+
* even the tiny fraction of users.
110+
*/
107111
DEPRECATION_LOGGER.warn(
108112
DeprecationCategory.MAPPINGS,
109113
"shape_multifields",
110-
"Adding multifields to [shape] mappers has no effect and will be forbidden in future"
114+
"Adding multifields to [shape] mappers has no effect"
111115
);
112116
}
113117
GeometryParser geometryParser = new GeometryParser(

x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/GeoShapeWithDocValuesFieldMapperTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ public void testMultiFieldsDeprecationWarning() throws Exception {
519519
b.startObject("keyword").field("type", "keyword").endObject();
520520
b.endObject();
521521
}));
522-
assertWarnings("Adding multifields to [" + getFieldName() + "] mappers has no effect and will be forbidden in future");
522+
assertWarnings("Adding multifields to [" + getFieldName() + "] mappers has no effect");
523523
}
524524

525525
public void testSelfIntersectPolygon() throws IOException {

x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapperTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ public void testMultiFieldsDeprecationWarning() throws Exception {
368368
b.startObject("keyword").field("type", "keyword").endObject();
369369
b.endObject();
370370
}));
371-
assertWarnings("Adding multifields to [point] mappers has no effect and will be forbidden in future");
371+
assertWarnings("Adding multifields to [point] mappers has no effect");
372372
}
373373

374374
@Override

x-pack/plugin/spatial/src/test/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapperTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ public void testMultiFieldsDeprecationWarning() throws Exception {
338338
b.startObject("keyword").field("type", "keyword").endObject();
339339
b.endObject();
340340
}));
341-
assertWarnings("Adding multifields to [" + getFieldName() + "] mappers has no effect and will be forbidden in future");
341+
assertWarnings("Adding multifields to [" + getFieldName() + "] mappers has no effect");
342342
}
343343

344344
public void testSelfIntersectPolygon() throws IOException {

0 commit comments

Comments
 (0)