diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index cea2033050..993fec31e7 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -8542,6 +8542,10 @@ "$ref": "#/components/schemas/esql._types:TableValuesContainer" } } + }, + "include_ccs_metadata": { + "description": "When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.", + "type": "boolean" } }, "required": [ @@ -8756,6 +8760,10 @@ "$ref": "#/components/schemas/esql._types:TableValuesContainer" } } + }, + "include_ccs_metadata": { + "description": "When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.", + "type": "boolean" } }, "required": [ diff --git a/output/openapi/elasticsearch-serverless-openapi.json b/output/openapi/elasticsearch-serverless-openapi.json index 1a5c38325d..280bdf137e 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -5207,6 +5207,10 @@ "$ref": "#/components/schemas/esql._types:TableValuesContainer" } } + }, + "include_ccs_metadata": { + "description": "When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.", + "type": "boolean" } }, "required": [ diff --git a/output/schema/schema-serverless.json b/output/schema/schema-serverless.json index a2ff5fa6e6..ab052fd87f 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -18285,6 +18285,18 @@ } } } + }, + { + "description": "If provided and `true`, the response will include an extra `_clusters` object with information\nabout the clusters that participated in the search along with info such as shards count.", + "name": "include_ccs_metadata", + "required": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ] }, @@ -18340,7 +18352,7 @@ } } ], - "specLocation": "esql/query/QueryRequest.ts#L27-L92" + "specLocation": "esql/query/QueryRequest.ts#L27-L103" }, { "body": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 89d1b3bb35..d8f5d0ca2b 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -120853,6 +120853,19 @@ } } } + }, + { + "description": "When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.", + "name": "include_ccs_metadata", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ] }, @@ -120946,7 +120959,7 @@ } } ], - "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L118" + "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L125" }, { "kind": "response", @@ -121263,6 +121276,19 @@ } } } + }, + { + "description": "When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters`\nobject with information about the clusters that participated in the search along with info such as shards\ncount.", + "name": "include_ccs_metadata", + "required": false, + "serverDefault": false, + "type": { + "kind": "instance_of", + "type": { + "name": "boolean", + "namespace": "_builtins" + } + } } ] }, @@ -121317,7 +121343,7 @@ } } ], - "specLocation": "esql/query/QueryRequest.ts#L27-L92" + "specLocation": "esql/query/QueryRequest.ts#L27-L105" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 3230e6c0a4..884e92805e 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -10478,6 +10478,7 @@ export interface EsqlAsyncQueryRequest extends RequestBase { profile?: boolean query: string tables?: Record> + include_ccs_metadata?: boolean } } @@ -10512,6 +10513,7 @@ export interface EsqlQueryRequest extends RequestBase { profile?: boolean query: string tables?: Record> + include_ccs_metadata?: boolean } } diff --git a/specification/esql/async_query/AsyncQueryRequest.ts b/specification/esql/async_query/AsyncQueryRequest.ts index a8b25c4e26..9f918d9114 100644 --- a/specification/esql/async_query/AsyncQueryRequest.ts +++ b/specification/esql/async_query/AsyncQueryRequest.ts @@ -114,5 +114,12 @@ export interface Request extends RequestBase { * name and the next level key is the column name. */ tables?: Dictionary> + /** + * When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters` + * object with information about the clusters that participated in the search along with info such as shards + * count. + * @server_default false + */ + include_ccs_metadata?: boolean } } diff --git a/specification/esql/async_query/examples/request/AsyncQueryRequestExample1.yaml b/specification/esql/async_query/examples/request/AsyncQueryRequestExample1.yaml index 1cafcc7712..968c685778 100644 --- a/specification/esql/async_query/examples/request/AsyncQueryRequestExample1.yaml +++ b/specification/esql/async_query/examples/request/AsyncQueryRequestExample1.yaml @@ -2,4 +2,15 @@ # method_request: "POST /_query/async" # description: # type: request -value: "{\n \"query\": \"\"\"\n FROM library\n | EVAL year = DATE_TRUNC(1 YEARS, release_date)\n | STATS MAX(page_count) BY year\n | SORT year\n | LIMIT 5\n \"\"\",\n \"wait_for_completion_timeout\": \"2s\"\n}" +value: |- + { + "query": """ + FROM library,remote-*:library + | EVAL year = DATE_TRUNC(1 YEARS, release_date) + | STATS MAX(page_count) BY year + | SORT year + | LIMIT 5 + """, + "wait_for_completion_timeout": "2s", + "include_ccs_metadata": true + } diff --git a/specification/esql/query/QueryRequest.ts b/specification/esql/query/QueryRequest.ts index 8be31fefa0..0fe159dee3 100644 --- a/specification/esql/query/QueryRequest.ts +++ b/specification/esql/query/QueryRequest.ts @@ -88,5 +88,12 @@ export interface Request extends RequestBase { * name and the next level key is the column name. */ tables?: Dictionary> + /** + * When set to `true` and performing a cross-cluster query, the response will include an extra `_clusters` + * object with information about the clusters that participated in the search along with info such as shards + * count. + * @server_default false + */ + include_ccs_metadata?: boolean } } diff --git a/specification/esql/query/examples/request/QueryRequestExample1.yaml b/specification/esql/query/examples/request/QueryRequestExample1.yaml index e6167f7175..14cb30810d 100644 --- a/specification/esql/query/examples/request/QueryRequestExample1.yaml +++ b/specification/esql/query/examples/request/QueryRequestExample1.yaml @@ -5,10 +5,11 @@ description: Run `POST /_query` to get results for an ES|QL query. value: |- { "query": """ - FROM library + FROM library,remote-*:library | EVAL year = DATE_TRUNC(1 YEARS, release_date) | STATS MAX(page_count) BY year | SORT year | LIMIT 5 - """ + """, + "include_ccs_metadata": true }