Skip to content

Commit

Permalink
Fix terms query schema (#564)
Browse files Browse the repository at this point in the history
* Fix terms query schema

Signed-off-by: Thomas Farr <[email protected]>

* Add changelog

Signed-off-by: Thomas Farr <[email protected]>

---------

Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia authored Sep 10, 2024
1 parent 29185f4 commit 3dcced9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Added `AwarenessAttributeStats` to `/_cluster/health` ([#534](https://github.com/opensearch-project/opensearch-api-specification/pull/534))
- Added `cache_reserved_in_bytes` to `ClusterFileSystem` ([#534](https://github.com/opensearch-project/opensearch-api-specification/pull/534))
- Added `cluster_manager` to `ClusterNodeCount` ([#534](https://github.com/opensearch-project/opensearch-api-specification/pull/534))
- Added support for `query` with `terms` in `_search` ([#546](https://github.com/opensearch-project/opensearch-api-specification/pull/546))
- Added support for `query` with `terms` in `_search` ([#546](https://github.com/opensearch-project/opensearch-api-specification/pull/546))([#564](https://github.com/opensearch-project/opensearch-api-specification/pull/564))
- Added `h`, `bytes`, `time` parameters to cat API tests ([#551](https://github.com/opensearch-project/opensearch-api-specification/pull/551))
- Added `terminated_early` to `count@200` ([#547](https://github.com/opensearch-project/opensearch-api-specification/pull/547))
- Added request and response schemas for `/_cluster/routing/awareness/{attribute}/weights` ([#524](https://github.com/opensearch-project/opensearch-api-specification/pull/524))
Expand Down
42 changes: 22 additions & 20 deletions spec/schemas/_common.query_dsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,15 @@ components:
minProperties: 1
maxProperties: 1
terms:
$ref: '#/components/schemas/TermsQuery'
type: object
additionalProperties:
anyOf:
- $ref: '#/components/schemas/TermsQuery'
- type: array
items:
type: string
minProperties: 1
maxProperties: 1
terms_set:
description: |-
Returns documents that contain a minimum number of exact terms in a provided field.
Expand Down Expand Up @@ -280,23 +288,6 @@ components:
type: number
_name:
type: string
Terms:
oneOf:
- type: array
items:
type: string
- type: object
properties:
index:
$ref: '_common.yaml#/components/schemas/IndexName'
id:
$ref: '_common.yaml#/components/schemas/Id'
path:
$ref: '_common.yaml#/components/schemas/Field'
routing:
$ref: '_common.yaml#/components/schemas/Routing'
additionalProperties: true
description: Object for fetching terms.
BoostingQuery:
allOf:
- $ref: '#/components/schemas/QueryBase'
Expand Down Expand Up @@ -1891,7 +1882,16 @@ components:
TermsQuery:
anyOf:
- $ref: '#/components/schemas/QueryBase'
- $ref: '#/components/schemas/Terms'
- type: object
properties:
index:
$ref: '_common.yaml#/components/schemas/IndexName'
id:
$ref: '_common.yaml#/components/schemas/Id'
path:
$ref: '_common.yaml#/components/schemas/Field'
routing:
$ref: '_common.yaml#/components/schemas/Routing'
TermsSetQuery:
allOf:
- $ref: '#/components/schemas/QueryBase'
Expand All @@ -1902,7 +1902,9 @@ components:
minimum_should_match_script:
$ref: '_common.yaml#/components/schemas/Script'
terms:
$ref: '#/components/schemas/Terms'
type: array
items:
type: string
required:
- terms
TextExpansionQuery:
Expand Down

0 comments on commit 3dcced9

Please sign in to comment.