Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/reference/esql/esql-across-clusters.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,8 @@ which clusters have slower response times than others.
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.
<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 <<esql-async-query-stop-api,async query stop API>>.
for example if it was interrupted before finishing using the <<esql-async-query-stop-api,async query stop API>>,
or one of the remotes or shards failed.


The cross-cluster metadata can be used to determine whether any data came back from a cluster.
Expand Down
17 changes: 14 additions & 3 deletions docs/reference/esql/esql-query-api.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ You can also specify a format using the `Accept` HTTP header. If you specify
both this parameter and the `Accept` HTTP header, this parameter takes
precedence.

`allow_partial_results`::
(Optional, boolean) If `true`, partial results will be returned if there are shard failures, but
the query can continue to execute on other clusters and shards. This defaults to the value of
the cluster setting `esql.query.allow_partial_results`.

[discrete]
[role="child_attributes"]
[[esql-query-api-request-body]]
Expand Down Expand Up @@ -120,11 +125,17 @@ returned if `drop_null_columns` is sent with the request.
(array of arrays)
Values for the search results.

`is_partial`::
(boolean)
Indicates whether the response is partial. Partial responses can happen due to partial shard failures,
failures in remote clusters, or if the async query was stopped by calling the <<esql-async-query-stop-api,async query stop API>>.

`_clusters`::
(object)
Metadata about clusters involved in the execution of a cross-cluster query. Only returned (1) for
cross-cluster searches and (2) when `include_ccs_metadata` is sent in the body and set to `true`
and (3) when `format` of the response is set to JSON (the default), CBOR, SMILE, or YAML.
Metadata about clusters involved in the execution of a query. This field is present in the response in the following cases:
(1) for cross-cluster searches, when `include_ccs_metadata` is sent in the body and set to `true`;
(2) the result is partial (`is_partial` is `true`) and there are failures on some clusters.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: if all shards were successful in the local cluster, will the _clusters be included in the response if remotes have partial shard failures even if include_ccs_metadata is false?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, if there are any failures that make the response partial, then _clusters will be included together with the failures.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: metadata would be present if the query is stopped, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, unless there are any failures, it's one of 1) include_ccs_metadata + CSS; or 2) partial + failures. If there are no failures to report then 2) is not activated.

It is only returned if the `format` of the response is set to JSON (the default), CBOR, SMILE, or YAML.
See <<ccq-cluster-details>> for more information.

`profile`::
Expand Down