From 704a5740999792959aa51e4b8f273a9334c83f5c Mon Sep 17 00:00:00 2001 From: Lisa Cawley Date: Wed, 23 Oct 2024 15:02:40 -0700 Subject: [PATCH 1/2] [OpenAPI] Add more x-model and @ext_doc_id values (#3048) (cherry picked from commit dad2aa1db978e064717e2cfbb31b48643be151d1) --- docs/overlays/elasticsearch-openapi-overlays.yaml | 4 ++++ docs/overlays/elasticsearch-shared-overlays.yaml | 11 +++++++++++ output/openapi/elasticsearch-openapi.json | 3 +++ .../openapi/elasticsearch-serverless-openapi.json | 3 +++ output/schema/schema.json | 14 +++++++++----- specification/_doc_ids/table.csv | 1 + specification/_global/msearch/types.ts | 5 ++++- .../_global/search/_types/FieldCollapse.ts | 3 +++ 8 files changed, 38 insertions(+), 6 deletions(-) diff --git a/docs/overlays/elasticsearch-openapi-overlays.yaml b/docs/overlays/elasticsearch-openapi-overlays.yaml index f7f85da901..e88bf0c7bd 100644 --- a/docs/overlays/elasticsearch-openapi-overlays.yaml +++ b/docs/overlays/elasticsearch-openapi-overlays.yaml @@ -9,10 +9,14 @@ actions: update: title: Elasticsearch API description: > + Elasticsearch provides REST APIs that are used by the UI components and can be called directly to configure and access Elasticsearch features. + ## Documentation source and versions This documentation is derived from the `8.x` branch of the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification) repository. It is provided under license [Attribution-NonCommercial-NoDerivatives 4.0 International](https://creativecommons.org/licenses/by-nc-nd/4.0/). + + This documentation contains work-in-progress information for future Elastic Stack releases. x-doc-license: name: Attribution-NonCommercial-NoDerivatives 4.0 International url: 'https://creativecommons.org/licenses/by-nc-nd/4.0/' diff --git a/docs/overlays/elasticsearch-shared-overlays.yaml b/docs/overlays/elasticsearch-shared-overlays.yaml index 30824c5dd6..32e2656a69 100644 --- a/docs/overlays/elasticsearch-shared-overlays.yaml +++ b/docs/overlays/elasticsearch-shared-overlays.yaml @@ -1070,6 +1070,17 @@ actions: externalDocs: url: https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl.html description: Query DSL + - target: "$.components['schemas']['_global.search._types:FieldCollapse']" + description: Add x-model and externalDocs + update: + x-model: true + externalDocs: + url: https://www.elastic.co/guide/en/elasticsearch/reference/master/collapse-search-results.html + - target: "$.components['schemas']['_global.msearch:MultisearchBody'].properties" + description: Add x-model + update: + aggregations: + x-model: true # Examples - target: "$.components['requestBodies']['async_search.submit']" description: "Add example for asynch search submit request" diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 0e44dfd86d..806c4e52d0 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -64881,6 +64881,9 @@ "type": "object", "properties": { "aggregations": { + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html" + }, "type": "object", "additionalProperties": { "$ref": "#/components/schemas/_types.aggregations:AggregationContainer" diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 80aa96e3f3..889adbbc1a 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -52157,6 +52157,9 @@ "type": "object", "properties": { "aggregations": { + "externalDocs": { + "url": "https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html" + }, "type": "object", "additionalProperties": { "$ref": "#/components/schemas/_types.aggregations:AggregationContainer" diff --git a/output/schema/schema.json b/output/schema/schema.json index eef0be4cae..f697786a37 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -27537,7 +27537,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L213-L216" + "specLocation": "_global/msearch/types.ts#L216-L219" }, { "kind": "interface", @@ -27587,7 +27587,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L203-L206" + "specLocation": "_global/msearch/types.ts#L206-L209" }, { "kind": "interface", @@ -27600,6 +27600,8 @@ "aliases": [ "aggs" ], + "extDocId": "search-aggregations", + "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations.html", "name": "aggregations", "required": false, "type": { @@ -28059,7 +28061,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L70-L201" + "specLocation": "_global/msearch/types.ts#L70-L204" }, { "kind": "interface", @@ -28485,7 +28487,7 @@ "name": "ResponseItem", "namespace": "_global.msearch" }, - "specLocation": "_global/msearch/types.ts#L208-L211", + "specLocation": "_global/msearch/types.ts#L211-L214", "type": { "kind": "union_of", "items": [ @@ -35122,6 +35124,8 @@ }, { "kind": "interface", + "extDocId": "collapse-search-results", + "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/collapse-search-results.html", "name": { "name": "FieldCollapse", "namespace": "_global.search._types" @@ -35190,7 +35194,7 @@ } } ], - "specLocation": "_global/search/_types/FieldCollapse.ts#L24-L38" + "specLocation": "_global/search/_types/FieldCollapse.ts#L24-L41" }, { "kind": "interface", diff --git a/specification/_doc_ids/table.csv b/specification/_doc_ids/table.csv index c90d944c2e..a534c32bca 100644 --- a/specification/_doc_ids/table.csv +++ b/specification/_doc_ids/table.csv @@ -80,6 +80,7 @@ cluster,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cluster common-options,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/common-options.html community-id-processor,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/community-id-processor.html connector-sync-job-cancel,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/cancel-connector-sync-job-api.html +collapse-search-results,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/collapse-search-results.html connector-sync-job-delete,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/delete-connector-sync-job-api.html connector-sync-job-get,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/get-connector-sync-job-api.html connector-sync-job-post,https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/create-connector-sync-job-api.html diff --git a/specification/_global/msearch/types.ts b/specification/_global/msearch/types.ts index bfc20059ac..ec6efbf38b 100644 --- a/specification/_global/msearch/types.ts +++ b/specification/_global/msearch/types.ts @@ -68,7 +68,10 @@ export class MultisearchHeader { // We should keep this in sync with the normal search request body. export class MultisearchBody { - /** @aliases aggs */ // ES uses "aggregations" in serialization + /** + * @aliases aggs + * @ext_doc_id search-aggregations + */ // ES uses "aggregations" in serialization aggregations?: Dictionary collapse?: FieldCollapse /** diff --git a/specification/_global/search/_types/FieldCollapse.ts b/specification/_global/search/_types/FieldCollapse.ts index bc867ad4d8..2afdd7baee 100644 --- a/specification/_global/search/_types/FieldCollapse.ts +++ b/specification/_global/search/_types/FieldCollapse.ts @@ -21,6 +21,9 @@ import { Field } from '@_types/common' import { integer } from '@_types/Numeric' import { InnerHits } from './hits' +/** + * @ext_doc_id collapse-search-results + */ export class FieldCollapse { /** * The field to collapse the result set on From 942a22e840dbb8a557ebf182dccc67d23b1cfdd2 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 23 Oct 2024 15:11:02 -0700 Subject: [PATCH 2/2] Regenerate output --- output/schema/schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/output/schema/schema.json b/output/schema/schema.json index f697786a37..9f0339f1fc 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -85947,7 +85947,7 @@ ], "meta": { "key": "field", - "value": "term" + "value": "terms" }, "type": { "name": "AdditionalProperty",