From 32ce2fead86870fea96ee531354f5b1c479bfa3b Mon Sep 17 00:00:00 2001 From: "Theo N. Truong" Date: Thu, 9 Jan 2025 14:31:06 -0700 Subject: [PATCH] Added `aggs` property as an alias to `aggregations` in requestBody of `search` (#775) Signed-off-by: Theo Truong --- CHANGELOG.md | 1 + spec/namespaces/_core.yaml | 5 +++++ tests/default/_core/search/aggregations/avg.yaml | 2 +- tests/default/_core/search/aggregations/historgram.yaml | 2 +- tests/default/_core/search/aggregations/max.yaml | 2 +- tests/default/_core/search/aggregations/min.yaml | 2 +- 6 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d9172f985..ea5d565b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) - Added `GET /_plugins/_ml/connectors/{connector_id}`, `_search`, `POST /_plugins/_ml/connectors/_search`, and `PUT /_plugins/_ml/connectors/{connector_id}` ([#764](https://github.com/opensearch-project/opensearch-api-specification/pull/764)) - Added the ability to skip an individual chapter test ([#765](https://github.com/opensearch-project/opensearch-api-specification/pull/765)) - Added uploading of test spec logs ([#767](https://github.com/opensearch-project/opensearch-api-specification/pull/767)) +- Added `aggs` property as an alias to `aggregations` in requestBody of `search` [#774](https://github.com/opensearch-project/opensearch-api-specification/issues/774) - Added `POST /_plugins/_ml/memory`, `POST /_plugins/_ml/memory/_search`, `{memory_id}/_search`, `{memory_id}/messages`, `PUT /_plugins/_ml/memory/{memory_id}`, `message/{message_id}`, `GET /_plugins/_ml/memory`, `GET /_plugins/_ml/memory/{memory_id}`, `_search`, `message/{message_id}`, `{memory_id}/messages`, `{memory_id}/_search`, `message/{message_id}/traces`, and `DELETE /_plugins/_ml/memory/{memory_id}` ([#771](https://github.com/opensearch-project/opensearch-api-specification/pull/771)) - Added support for evaluating response payloads in prologues and epilogues ([#772](https://github.com/opensearch-project/opensearch-api-specification/pull/772)) diff --git a/spec/namespaces/_core.yaml b/spec/namespaces/_core.yaml index 74f9f27ac..ee5ca443e 100644 --- a/spec/namespaces/_core.yaml +++ b/spec/namespaces/_core.yaml @@ -2538,6 +2538,11 @@ components: type: object additionalProperties: $ref: '../schemas/_common.aggregations.yaml#/components/schemas/AggregationContainer' + aggs: + description: Defines the aggregations that are run as part of the search request. + type: object + additionalProperties: + $ref: '../schemas/_common.aggregations.yaml#/components/schemas/AggregationContainer' collapse: $ref: '../schemas/_core.search.yaml#/components/schemas/FieldCollapse' explain: diff --git a/tests/default/_core/search/aggregations/avg.yaml b/tests/default/_core/search/aggregations/avg.yaml index 52daa7ecb..13f0a3a46 100644 --- a/tests/default/_core/search/aggregations/avg.yaml +++ b/tests/default/_core/search/aggregations/avg.yaml @@ -22,7 +22,7 @@ chapters: request: payload: size: 0 - aggregations: + aggs: duration_avg: avg: field: duration diff --git a/tests/default/_core/search/aggregations/historgram.yaml b/tests/default/_core/search/aggregations/historgram.yaml index 03adc94f4..a5335a7a0 100644 --- a/tests/default/_core/search/aggregations/historgram.yaml +++ b/tests/default/_core/search/aggregations/historgram.yaml @@ -24,7 +24,7 @@ chapters: request: payload: size: 0 - aggregations: + aggs: movies: histogram: field: year diff --git a/tests/default/_core/search/aggregations/max.yaml b/tests/default/_core/search/aggregations/max.yaml index 4d05066b2..ca3940b58 100644 --- a/tests/default/_core/search/aggregations/max.yaml +++ b/tests/default/_core/search/aggregations/max.yaml @@ -22,7 +22,7 @@ chapters: request: payload: size: 0 - aggregations: + aggs: duration_max: max: field: duration diff --git a/tests/default/_core/search/aggregations/min.yaml b/tests/default/_core/search/aggregations/min.yaml index 0d0f6197c..270682ddf 100644 --- a/tests/default/_core/search/aggregations/min.yaml +++ b/tests/default/_core/search/aggregations/min.yaml @@ -22,7 +22,7 @@ chapters: request: payload: size: 0 - aggregations: + aggs: duration_min: min: field: duration