Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update spec and add tests for xy, geo shape, and geo bounding box query #531

Merged
merged 13 commits into from
Sep 9, 2024

Conversation

kolchfa-aws
Copy link
Contributor

Closes #516

This PR includes the following changes:

  • Change shape query to xy_shape query and add specs for xy_point and xy_shape
  • Update spec for geo_shape query
  • Update spec for geo_bounding_box query
  • Add tests for the 3 query types mentioned above

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Copy link
Contributor

github-actions bot commented Aug 26, 2024

Changes Analysis

Commit SHA: 17133e3
Comparing To SHA: 9193d58

API Changes

Summary

└─┬Components
  ├──[➖] schemas (36630:7)❌ 
  ├──[➖] schemas (38486:7)❌ 
  ├──[➖] schemas (36409:7)❌ 
  ├──[➕] schemas (37339:7)
  ├──[➕] schemas (36902:7)
  ├──[➕] schemas (38916:7)
  ├──[➕] schemas (38907:7)
  ├──[➕] schemas (37346:7)
  ├──[➕] schemas (38900:7)
  ├──[➕] schemas (36885:7)
  ├──[➕] schemas (30251:7)
  ├──[➕] schemas (30238:7)
  ├─┬_common.query_dsl:QueryContainer
  │ ├──[➖] properties (38180:9)❌ 
  │ └──[➕] properties (38304:9)
  ├─┬_common.query_dsl:GeoShapeQuery
  │ └─┬ALLOF
  │   ├──[➕] additionalProperties (37362:13)❌ 
  │   └──[➕] minProperties (37363:26)❌ 
  ├─┬_common.mapping:GeoShapeProperty
  │ └─┬ALLOF
  │   └──[➕] properties (36108:13)
  ├─┬_common.query_dsl:GeoBoundingBoxQuery
  │ └─┬ALLOF
  │   ├──[➕] additionalProperties (37296:13)❌ 
  │   └──[➕] minProperties (37297:26)❌ 
  └─┬_common.mapping:Property
    ├─┬ONEOF
    │ └──[🔀] $ref (36617:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35625:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36291:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36524:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36225:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35829:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36324:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36334:13)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36873:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36363:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35680:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35710:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36783:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36644:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35882:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36164:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36188:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35748:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36311:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36862:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36689:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35913:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36094:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36061:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36849:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36374:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36886:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35779:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35723:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36048:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35802:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (36019:9)❌ 
    ├─┬ONEOF
    │ └──[🔀] $ref (35855:9)❌ 
    └─┬ONEOF
      └──[🔀] $ref (36903:9)❌ 

Document Element Total Changes Breaking Changes
components 53 46
  • BREAKING Changes: 46 out of 53
  • Modifications: 34
  • Removals: 4
  • Additions: 15
  • Breaking Removals: 4
  • Breaking Modifications: 34
  • Breaking Additions: 4

Report

The full API changes report is available at: https://github.com/opensearch-project/opensearch-api-specification/actions/runs/10774487911/artifacts/1909221389

API Coverage

Before After Δ
Covered (%) 537 (52.6 %) 537 (52.6 %) 0 (0 %)
Uncovered (%) 484 (47.4 %) 484 (47.4 %) 0 (0 %)
Unknown 26 26 0

@kolchfa-aws kolchfa-aws marked this pull request as draft August 26, 2024 13:59
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
@dblock
Copy link
Member

dblock commented Aug 26, 2024

Nice work @kolchfa-aws, looking forward to a passing CI. Btw, you can auto-lint-fix with npm run lint--fix.

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
@kolchfa-aws
Copy link
Contributor Author

The sort-sequence-values rule seems a bit restrictive. In my case, the list specified a geo envelope so (4, 2) was a perfectly fine pair of Cartesian coordinates :)

@kolchfa-aws
Copy link
Contributor Author

kolchfa-aws commented Sep 5, 2024

@dblock @nhtruong Could I get some help with this PR? The tests run locally but are breaking here.

Also, I understand that the spec test linter requires me extract object definitions into separate objects and refer to them using ref but when I try to do it, I get an error. This is fixed.

Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're just missing a version check because I believe half of these didn't work before 2.4.

I am also pretty sure the hard-coded field is an issue, but I could be wrong.

CHANGELOG.md Outdated Show resolved Hide resolved
spec/schemas/_common.query_dsl.yaml Outdated Show resolved Hide resolved
tests/default/_core/search/geo_bounding_box.yaml Outdated Show resolved Hide resolved
tests/default/_core/search/geo_bounding_box.yaml Outdated Show resolved Hide resolved
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Signed-off-by: Fanit Kolchina <kolchfa@amazon.com>
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests are failing because of #558, I'll fix it but for now comment out x-version-added in _common.mapping.yaml.

spec/schemas/_common.yaml Outdated Show resolved Hide resolved
spec/schemas/_common.yaml Outdated Show resolved Hide resolved
spec/schemas/_common.yaml Outdated Show resolved Hide resolved
spec/schemas/_common.mapping.yaml Outdated Show resolved Hide resolved
spec/schemas/_common.mapping.yaml Outdated Show resolved Hide resolved
Co-authored-by: Daniel (dB.) Doubrovkine <dblock@dblock.org>
Signed-off-by: kolchfa-aws <105444904+kolchfa-aws@users.noreply.github.com>
Copy link
Contributor

github-actions bot commented Sep 9, 2024

Spec Test Coverage Analysis

Total Tested
563 271 (48.13 %)

@kolchfa-aws kolchfa-aws marked this pull request as ready for review September 9, 2024 13:56
Copy link
Member

@dblock dblock left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏

@dblock dblock merged commit 5cd57c4 into opensearch-project:main Sep 9, 2024
18 checks passed

description: Test search endpoint with geo_bounding_box query.
prologues:
- path: /point_index
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed this one, but would be nice to use the cinema/movie/books here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done #562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]Change shape query to xy query and add xy point and xy shape to the spec
2 participants