From ce1395957205a335a91d7e389ea92026b4d2a804 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Tue, 11 Jun 2024 15:37:25 -0500 Subject: [PATCH 1/2] Demonstrate that arrays of `geo_shape` can no longer be ingested This was first broken in commit ebe6f2c2878f036cb4c1147683c30091747d7632 Demonstrates #14193 Signed-off-by: Kurt McKee --- .../geo_shape/300_array_of_geo_shapes.yml | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/300_array_of_geo_shapes.yml diff --git a/modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/300_array_of_geo_shapes.yml b/modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/300_array_of_geo_shapes.yml new file mode 100644 index 0000000000000..8c4952589df88 --- /dev/null +++ b/modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/300_array_of_geo_shapes.yml @@ -0,0 +1,67 @@ +setup: + - do: + indices.create: + index: test + body: + settings: + number_of_replicas: 0 + mappings: + properties: + location: + type: "geo_shape" + +--- +"Single shape": + - do: + bulk: + refresh: true + body: + - index: + _index: test + _id: 1 + - location: + type: "polygon" + coordinates: [ + [ + [ -87.0, 41.0 ], + [ -88.0, 41.0 ], + [ -88.0, 42.0 ], + [ -87.0, 42.0 ], + [ -87.0, 41.0 ], + ] + ] + + - match: {errors: false} + +--- +"Array of shapes": + - do: + bulk: + refresh: true + body: + - index: + _index: test + _id: 1 + - location: + - type: "polygon" + coordinates: [ + [ + [ -87.0, 41.0 ], + [ -88.0, 41.0 ], + [ -88.0, 42.0 ], + [ -87.0, 42.0 ], + [ -87.0, 41.0 ], + ] + ] + - type: "polygon" + coordinates: [ + [ + [ -97.0, 41.0 ], + [ -98.0, 41.0 ], + [ -98.0, 42.0 ], + [ -97.0, 42.0 ], + [ -97.0, 41.0 ], + ] + ] + + - match: {errors: false} From 674dd0dd21dc651f2bcf23a9d67d8466bcbc0e4d Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Thu, 13 Jun 2024 09:15:13 -0500 Subject: [PATCH 2/2] Feedback: Also test `doc_values: false` Signed-off-by: Kurt McKee --- ...0_array_of_geo_shapes_doc_values_false.yml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/300_array_of_geo_shapes_doc_values_false.yml diff --git a/modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/300_array_of_geo_shapes_doc_values_false.yml b/modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/300_array_of_geo_shapes_doc_values_false.yml new file mode 100644 index 0000000000000..572a1275d41dd --- /dev/null +++ b/modules/geo/src/yamlRestTest/resources/rest-api-spec/test/geo_shape/300_array_of_geo_shapes_doc_values_false.yml @@ -0,0 +1,68 @@ +setup: + - do: + indices.create: + index: test + body: + settings: + number_of_replicas: 0 + mappings: + properties: + location: + type: "geo_shape" + doc_values: false + +--- +"Single shape": + - do: + bulk: + refresh: true + body: + - index: + _index: test + _id: 1 + - location: + type: "polygon" + coordinates: [ + [ + [ -87.0, 41.0 ], + [ -88.0, 41.0 ], + [ -88.0, 42.0 ], + [ -87.0, 42.0 ], + [ -87.0, 41.0 ], + ] + ] + + - match: {errors: false} + +--- +"Array of shapes": + - do: + bulk: + refresh: true + body: + - index: + _index: test + _id: 1 + - location: + - type: "polygon" + coordinates: [ + [ + [ -87.0, 41.0 ], + [ -88.0, 41.0 ], + [ -88.0, 42.0 ], + [ -87.0, 42.0 ], + [ -87.0, 41.0 ], + ] + ] + - type: "polygon" + coordinates: [ + [ + [ -97.0, 41.0 ], + [ -98.0, 41.0 ], + [ -98.0, 42.0 ], + [ -97.0, 42.0 ], + [ -97.0, 41.0 ], + ] + ] + + - match: {errors: false}