diff --git a/output/openapi/elasticsearch-openapi.json b/output/openapi/elasticsearch-openapi.json index 9326359e87..6ec158e75c 100644 --- a/output/openapi/elasticsearch-openapi.json +++ b/output/openapi/elasticsearch-openapi.json @@ -8839,6 +8839,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": [ @@ -9102,6 +9106,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 27d0f7a302..5761bc6349 100644 --- a/output/openapi/elasticsearch-serverless-openapi.json +++ b/output/openapi/elasticsearch-serverless-openapi.json @@ -5255,6 +5255,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 9631c61016..b0d95c0059 100644 --- a/output/schema/schema-serverless.json +++ b/output/schema/schema-serverless.json @@ -18582,6 +18582,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" + } + } } ] }, @@ -18637,7 +18649,7 @@ } } ], - "specLocation": "esql/query/QueryRequest.ts#L27-L98" + "specLocation": "esql/query/QueryRequest.ts#L27-L103" }, { "body": { diff --git a/output/schema/schema.json b/output/schema/schema.json index 481825db90..ad9f981b8c 100644 --- a/output/schema/schema.json +++ b/output/schema/schema.json @@ -122380,6 +122380,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" + } + } } ] }, @@ -122473,7 +122486,7 @@ } } ], - "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L118" + "specLocation": "esql/async_query/AsyncQueryRequest.ts#L28-L125" }, { "kind": "response", @@ -122824,6 +122837,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" + } + } } ] }, @@ -122878,7 +122904,7 @@ } } ], - "specLocation": "esql/query/QueryRequest.ts#L27-L98" + "specLocation": "esql/query/QueryRequest.ts#L27-L105" }, { "kind": "response", diff --git a/output/typescript/types.ts b/output/typescript/types.ts index 6ae8663d68..5db4dbcfad 100644 --- a/output/typescript/types.ts +++ b/output/typescript/types.ts @@ -10557,6 +10557,7 @@ export interface EsqlAsyncQueryRequest extends RequestBase { profile?: boolean query: string tables?: Record> + include_ccs_metadata?: boolean } } @@ -10596,6 +10597,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 0f2ed505ed..12eb54b5dc 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 a9097b29b0..bce931aaac 100644 --- a/specification/esql/query/QueryRequest.ts +++ b/specification/esql/query/QueryRequest.ts @@ -94,5 +94,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 }