-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update spec and add tests for xy, geo shape, and geo bounding box que…
…ry (#531) * Adds xy shape query spec and test Signed-off-by: Fanit Kolchina <[email protected]> * Update spec and add tests for geo bounding box and geo shape Signed-off-by: Fanit Kolchina <[email protected]> * Address linter errors Signed-off-by: Fanit Kolchina <[email protected]> * Add version added to xy field types and query Signed-off-by: Fanit Kolchina <[email protected]> * Fix lint errors Signed-off-by: Fanit Kolchina <[email protected]> * Remove ShapeQuery from spec and make list ordered Signed-off-by: Fanit Kolchina <[email protected]> * Extract objects into refs Signed-off-by: Fanit Kolchina <[email protected]> * Extract last object and add changelog entry Signed-off-by: Fanit Kolchina <[email protected]> * Implement code review comments Signed-off-by: Fanit Kolchina <[email protected]> * Fix lint errors Signed-off-by: Fanit Kolchina <[email protected]> * Apply suggestions from code review Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> --------- Signed-off-by: Fanit Kolchina <[email protected]> Signed-off-by: kolchfa-aws <[email protected]> Co-authored-by: Daniel (dB.) Doubrovkine <[email protected]>
- Loading branch information
1 parent
9193d58
commit 5cd57c4
Showing
9 changed files
with
380 additions
and
24 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
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
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,60 @@ | ||
$schema: ../../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test search endpoint with geo_bounding_box query. | ||
prologues: | ||
- path: /point_index | ||
method: PUT | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
field: | ||
type: geo_point | ||
- path: /point_index/_doc/1 | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
field: | ||
lat: 74 | ||
lon: 40 | ||
status: [201] | ||
epilogues: | ||
- path: /point_index | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Search point_index for documents whose point objects are within the specified bounding box. | ||
path: /{index}/_search | ||
parameters: | ||
index: point_index | ||
method: GET | ||
request: | ||
payload: | ||
query: | ||
geo_bounding_box: | ||
field: | ||
top: 75 | ||
left: 28 | ||
bottom: 73 | ||
right: 41 | ||
validation_method: strict | ||
type: memory | ||
ignore_unmapped: false | ||
response: | ||
status: 200 | ||
payload: | ||
timed_out: false | ||
hits: | ||
total: | ||
value: 1 | ||
relation: eq | ||
max_score: 1 | ||
hits: | ||
- _index: point_index | ||
_score: 1 | ||
_source: | ||
field: | ||
lat: 74 | ||
lon: 40 |
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,52 @@ | ||
$schema: ../../../../../json_schemas/test_story.schema.yaml | ||
|
||
description: Test search endpoint with geo_shape query. | ||
prologues: | ||
- path: /cinemas | ||
method: PUT | ||
request: | ||
payload: | ||
mappings: | ||
properties: | ||
location: | ||
type: geo_point | ||
- path: /cinemas/_doc/1 | ||
method: POST | ||
parameters: | ||
refresh: true | ||
request: | ||
payload: | ||
location: [0.5, 3] | ||
status: [201] | ||
epilogues: | ||
- path: /cinemas | ||
method: DELETE | ||
status: [200, 404] | ||
chapters: | ||
- synopsis: Search cinemas for documents whose point objects are within the specified envelope. | ||
path: /{index}/_search | ||
parameters: | ||
index: cinemas | ||
method: GET | ||
request: | ||
payload: | ||
query: | ||
geo_shape: | ||
location: | ||
shape: | ||
type: envelope | ||
coordinates: [[0, 6], [1, 2]] | ||
response: | ||
status: 200 | ||
payload: | ||
timed_out: false | ||
hits: | ||
total: | ||
value: 1 | ||
relation: eq | ||
max_score: 0 | ||
hits: | ||
- _index: cinemas | ||
_score: 0 | ||
_source: | ||
location: [0.5, 3] |
Oops, something went wrong.