forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding version condition while adding geoshape doc values to the inde…
…x, to ensure backward compatibility. (opensearch-project#11095) Signed-off-by: Navneet Verma <navneev@amazon.com>
- Loading branch information
Showing
6 changed files
with
131 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
qa/rolling-upgrade/src/test/resources/rest-api-spec/test/mixed_cluster/30_geoshape.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
--- | ||
"Insert Document with geoshape field": | ||
- do: | ||
bulk: | ||
refresh: true | ||
body: | ||
- '{"index": {"_index": "geo_shape_index_old", "_id":191}}' | ||
- '{"name": "NEMO Science Museum","location": {"type": "envelope","coordinates": [ [100.0, 1.0], [101.0, 0.0] ]}}' | ||
- '{"index": {"_index": "geo_shape_index_old", "_id":219}}' | ||
- '{"name": "NEMO Science Museum","location": {"type": "envelope","coordinates": [ [100.0, 1.0], [106.0, 0.0] ]}}' | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
index: geo_shape_index_old | ||
- match: { hits.total: 2 } |
28 changes: 28 additions & 0 deletions
28
qa/rolling-upgrade/src/test/resources/rest-api-spec/test/old_cluster/30_geoshape.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
--- | ||
"Create index with Geoshape field": | ||
- do: | ||
indices.create: | ||
index: geo_shape_index_old | ||
body: | ||
settings: | ||
index: | ||
number_of_replicas: 2 | ||
mappings: | ||
"properties": | ||
"location": | ||
"type": "geo_shape" | ||
|
||
- do: | ||
bulk: | ||
refresh: true | ||
body: | ||
- '{"index": {"_index": "geo_shape_index_old", "_id":191}}' | ||
- '{"name": "NEMO Science Museum","location": {"type": "envelope","coordinates": [ [100.0, 1.0], [101.0, 0.0] ]}}' | ||
- '{"index": {"_index": "geo_shape_index_old", "_id":219}}' | ||
- '{"name": "NEMO Science Museum","location": {"type": "envelope","coordinates": [ [100.0, 1.0], [106.0, 0.0] ]}}' | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
index: geo_shape_index_old | ||
- match: { hits.total: 2 } |
61 changes: 61 additions & 0 deletions
61
qa/rolling-upgrade/src/test/resources/rest-api-spec/test/upgraded_cluster/30_geoshape.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
"Validate we are able to index documents after upgrade": | ||
- do: | ||
bulk: | ||
refresh: true | ||
body: | ||
- '{"index": {"_index": "geo_shape_index_old", "_id":191}}' | ||
- '{"name": "NEMO Science Museum","location": {"type": "envelope","coordinates": [ [100.0, 1.0], [101.0, 0.0] ]}}' | ||
- '{"index": {"_index": "geo_shape_index_old", "_id":219}}' | ||
- '{"name": "NEMO Science Museum","location": {"type": "envelope","coordinates": [ [100.0, 1.0], [106.0, 0.0] ]}}' | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
index: geo_shape_index_old | ||
- match: { hits.total: 2 } | ||
|
||
|
||
--- | ||
"Create index with Geoshape field in new cluster": | ||
- do: | ||
indices.create: | ||
index: geo_shape_index_new | ||
body: | ||
settings: | ||
index: | ||
number_of_replicas: 2 | ||
mappings: | ||
"properties": | ||
"location": | ||
"type": "geo_shape" | ||
|
||
- do: | ||
bulk: | ||
refresh: true | ||
body: | ||
- '{"index": {"_index": "geo_shape_index_new", "_id":191}}' | ||
- '{"name": "NEMO Science Museum","location": {"type": "envelope","coordinates": [ [100.0, 1.0], [101.0, 0.0] ]}}' | ||
- '{"index": {"_index": "geo_shape_index_new", "_id":219}}' | ||
- '{"name": "NEMO Science Museum","location": {"type": "envelope","coordinates": [ [100.0, 1.0], [106.0, 0.0] ]}}' | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
index: geo_shape_index_new | ||
- match: { hits.total: 2 } | ||
|
||
- do: | ||
search: | ||
rest_total_hits_as_int: true | ||
index: geo_shape_index_new | ||
body: | ||
aggregations: | ||
myaggregation: | ||
geo_bounds: | ||
field: "location" | ||
- match: { hits.total: 2 } | ||
- match: { aggregations.myaggregation.bounds.top_left.lat: 0.9999999823048711 } | ||
- match: { aggregations.myaggregation.bounds.top_left.lon: 99.99999999068677 } | ||
- match: { aggregations.myaggregation.bounds.bottom_right.lat: 0.0 } | ||
- match: { aggregations.myaggregation.bounds.bottom_right.lon: 105.99999996833503 } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters