diff --git a/CHANGELOG.md b/CHANGELOG.md index eb5cca8ee..c48b84eac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -145,6 +145,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Fixed query DSL `neural` field `query_image` set `contentEncoding` and `model_id` as optional ([#512](https://github.com/opensearch-project/opensearch-api-specification/pull/512)) - Fixed `knn` query specification ([#538](https://github.com/opensearch-project/opensearch-api-specification/pull/538)) - Fixed content-type for `/hot_threads` ([#543](https://github.com/opensearch-project/opensearch-api-specification/pull/543)) +- Fixed `geo_distance` query spec ([#560](https://github.com/opensearch-project/opensearch-api-specification/pull/560)) - Fixed `/_cluster/settings` returning flat results ([#545](https://github.com/opensearch-project/opensearch-api-specification/pull/545)) - Fixed missing fields in `_cat` API ([#551](https://github.com/opensearch-project/opensearch-api-specification/pull/551)) - Fixed `geo_distance` query spec ([#561](https://github.com/opensearch-project/opensearch-api-specification/pull/561)) diff --git a/spec/schemas/_common.query_dsl.yaml b/spec/schemas/_common.query_dsl.yaml index 7bb1b4a29..51dead39c 100644 --- a/spec/schemas/_common.query_dsl.yaml +++ b/spec/schemas/_common.query_dsl.yaml @@ -656,11 +656,11 @@ components: $ref: '#/components/schemas/GeoValidationMethod' ignore_unmapped: $ref: '#/components/schemas/IgnoreUnmapped' - field: - type: object + additionalProperties: + $ref: '_common.yaml#/components/schemas/GeoLocation' + minProperties: 2 required: - distance - - field GeoPolygonQuery: allOf: - $ref: '#/components/schemas/QueryBase' diff --git a/tests/default/_core/search/geo_distance.yaml b/tests/default/_core/search/query/geo_distance.yaml similarity index 80% rename from tests/default/_core/search/geo_distance.yaml rename to tests/default/_core/search/query/geo_distance.yaml index 3beff6865..21e93d156 100644 --- a/tests/default/_core/search/geo_distance.yaml +++ b/tests/default/_core/search/query/geo_distance.yaml @@ -1,34 +1,34 @@ -$schema: ../../../../json_schemas/test_story.schema.yaml +$schema: ../../../../../json_schemas/test_story.schema.yaml description: Test search endpoint with geo_distance query. prologues: - - path: /map + - path: /cinemas method: PUT request: payload: mappings: properties: - field: + location: type: geo_point - - path: /map/_doc/1 + - path: /cinemas/_doc/1 method: POST parameters: refresh: true request: payload: - field: + location: lat: 74 lon: 40.71 status: [201] epilogues: - - path: /map + - path: /cinemas method: DELETE status: [200, 404] chapters: - synopsis: Search for documents whose point objects are within the specified distance from the specified point. path: /{index}/_search parameters: - index: map + index: cinemas method: GET request: payload: @@ -38,7 +38,7 @@ chapters: distance_type: arc validation_method: strict ignore_unmapped: true - field: + location: lat: 73.5 lon: 40.5 response: @@ -51,10 +51,10 @@ chapters: relation: eq max_score: 1 hits: - - _index: map + - _index: cinemas _score: 1 _source: - field: + location: lat: 74 lon: 40.71