Skip to content

Commit ae0f58e

Browse files
authored
Update partial results handling (#806)
1 parent 8366745 commit ae0f58e

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

explore-analyze/query-filter/languages/esql-cross-clusters.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ FROM *:my-index-000001
202202

203203
## Cross-cluster metadata [ccq-cluster-details]
204204

205-
Using the `"include_ccs_metadata": true` option, users can request that ES|QL {{ccs}} responses include metadata about the search on each cluster (when the response format is JSON). Here we show an example using the async search endpoint. {{ccs-cap}} metadata is also present in the synchronous search endpoint response when requested.
205+
Using the `"include_ccs_metadata": true` option, users can request that ES|QL {{ccs}} responses include metadata about the search on each cluster (when the response format is JSON). Here we show an example using the async search endpoint. {{ccs-cap}} metadata is also present in the synchronous search endpoint response when requested. If the search returns partial results and there are partial shard or remote cluster failures, `_clusters` metadata containing the failures will be included in the response regardless of the `include_ccs_metadata` parameter.
206206

207207
```console
208208
POST /_query/async?format=json
@@ -289,8 +289,8 @@ Which returns:
289289
4. If you included indices from the local cluster you sent the request to in your {{ccs}}, it is identified as "(local)".
290290
5. How long (in milliseconds) the search took on each cluster. This can be useful to determine which clusters have slower response times than others.
291291
6. The shard details for the search on that cluster, including a count of shards that were skipped due to the can-match phase results. Shards are skipped when they cannot have any matching data and therefore are not included in the full ES|QL query.
292-
7. The `is_partial` field is set to `true` if the search has partial results for any reason, for example if it was interrupted before finishing using the [async query stop API](https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-async-query-stop-api.html).
293-
292+
7. The `is_partial` field is set to `true` if the search has partial results for any reason, for example due to partial shard failures,
293+
failures in remote clusters, or if the async query was stopped by calling the [async query stop API](https://www.elastic.co/guide/en/elasticsearch/reference/current/esql-async-query-stop-api.html).
294294

295295
The cross-cluster metadata can be used to determine whether any data came back from a cluster. For instance, in the query below, the wildcard expression for `cluster-two` did not resolve to a concrete index (or indices). The cluster is, therefore, marked as *skipped* and the total number of shards searched is set to zero.
296296

@@ -312,7 +312,7 @@ Which returns:
312312
{
313313
"is_running": false,
314314
"took": 55,
315-
"is_partial": false,
315+
"is_partial": true, <3>
316316
"columns": [
317317
...
318318
],
@@ -321,9 +321,9 @@ Which returns:
321321
],
322322
"_clusters": {
323323
"total": 2,
324-
"successful": 2,
324+
"successful": 1,
325325
"running": 0,
326-
"skipped": 0,
326+
"skipped": 1, <1>
327327
"partial": 0,
328328
"failed": 0,
329329
"details": {
@@ -356,6 +356,7 @@ Which returns:
356356

357357
1. This cluster is marked as *skipped*, since there were no matching indices on that cluster.
358358
2. Indicates that no shards were searched (due to not having any matching indices).
359+
3. Since one of the clusters is skipped, the search result is marked as partial.
359360

360361

361362

0 commit comments

Comments
 (0)