From e41e83661963fe5a0979b8b3a00b2edbcc92213a Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 22 Oct 2024 13:21:32 -0700 Subject: [PATCH 1/3] Abbreviate FieldCollapse --- docs/overlays/elasticsearch-shared-overlays.yaml | 6 ++++++ output/schema/schema.json | 4 +++- specification/_doc_ids/table.csv | 1 + specification/_global/search/_types/FieldCollapse.ts | 3 +++ 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/overlays/elasticsearch-shared-overlays.yaml b/docs/overlays/elasticsearch-shared-overlays.yaml index 6150292046..a3b40cb345 100644 --- a/docs/overlays/elasticsearch-shared-overlays.yaml +++ b/docs/overlays/elasticsearch-shared-overlays.yaml @@ -1070,6 +1070,12 @@ 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 # Examples - target: "$.components['requestBodies']['async_search.submit']" description: "Add example for asynch search submit request" diff --git a/output/schema/schema.json b/output/schema/schema.json index 58eb213a8b..311625275f 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -35090,6 +35090,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" @@ -35158,7 +35160,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 68351266d1..49693a64fe 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/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 6ac1723db348b0fe513be360785762f5af77d601 Mon Sep 17 00:00:00 2001 From: lcawl Date: Tue, 22 Oct 2024 15:19:51 -0700 Subject: [PATCH 2/3] [OpenAPI] Add more externalDocs and x-model values --- docs/overlays/elasticsearch-shared-overlays.yaml | 5 +++++ output/openapi/elasticsearch-openapi.json | 3 +++ output/openapi/elasticsearch-serverless-openapi.json | 3 +++ output/schema/schema.json | 10 ++++++---- specification/_global/msearch/types.ts | 5 ++++- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/overlays/elasticsearch-shared-overlays.yaml b/docs/overlays/elasticsearch-shared-overlays.yaml index a3b40cb345..3a1544dcef 100644 --- a/docs/overlays/elasticsearch-shared-overlays.yaml +++ b/docs/overlays/elasticsearch-shared-overlays.yaml @@ -1076,6 +1076,11 @@ actions: 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 e508f39991..4cd903da7b 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -64794,6 +64794,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 52179a01a6..e93365c74e 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -51969,6 +51969,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 311625275f..85cf23d09e 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -27505,7 +27505,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L213-L216" + "specLocation": "_global/msearch/types.ts#L216-L219" }, { "kind": "interface", @@ -27555,7 +27555,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L203-L206" + "specLocation": "_global/msearch/types.ts#L206-L209" }, { "kind": "interface", @@ -27568,6 +27568,8 @@ "aliases": [ "aggs" ], + "extDocId": "search-aggregations", + "extDocUrl": "https://www.elastic.co/guide/en/elasticsearch/reference/{branch}/search-aggregations.html", "name": "aggregations", "required": false, "type": { @@ -28027,7 +28029,7 @@ } } ], - "specLocation": "_global/msearch/types.ts#L70-L201" + "specLocation": "_global/msearch/types.ts#L70-L204" }, { "kind": "interface", @@ -28453,7 +28455,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": [ 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 /** From e04fbb99989fc65502935bf154f79f996b3674f8 Mon Sep 17 00:00:00 2001 From: lcawl Date: Wed, 23 Oct 2024 14:25:25 -0700 Subject: [PATCH 3/3] Add work-in-progress to intro --- docs/overlays/elasticsearch-openapi-overlays.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/overlays/elasticsearch-openapi-overlays.yaml b/docs/overlays/elasticsearch-openapi-overlays.yaml index 57a9442d3b..890fd217c2 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 `main` 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/'