Skip to content

Delay partial results#141073

Merged
chrisparrinello merged 59 commits intoelastic:mainfrom
chrisparrinello:delay_partial_results
Feb 17, 2026
Merged

Delay partial results#141073
chrisparrinello merged 59 commits intoelastic:mainfrom
chrisparrinello:delay_partial_results

Conversation

@chrisparrinello
Copy link
Copy Markdown
Contributor

Closes #139828.

Implements a new query param, partial_results, on _async_search/{id} to not calculate or return partial results if the query is still running. The query param defaults to true if not specified in the request. If partial_results is true and the search is still running, the search response will include any hits and partial aggregations that are available. If partial_results is false and the search is still running, the search response will not include any hits (but possibly include total hits) nor will include any partial aggregations.

Once the search is complete, the response will include the final results if successful or the partial results in the case of a failure. This is the same behavior as before the implementation of the partial_results query param.

@chrisparrinello chrisparrinello marked this pull request as ready for review February 2, 2026 16:09
@elasticsearchmachine elasticsearchmachine added the needs:triage Requires assignment of a team area label label Feb 2, 2026
@chrisparrinello chrisparrinello added >enhancement Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch and removed needs:triage Requires assignment of a team area label labels Feb 2, 2026
@chrisparrinello
Copy link
Copy Markdown
Contributor Author

Based on conversations with @quux00 and @naj-h, we decided to rename return_partial_results to return_intermediate_results to differentiate results that are partial due to some sort of failure with results that are partial because the search query is still in progress.

We think return_intermediate_results better describes the latter scenario, hence the name change.

Copy link
Copy Markdown
Contributor

@quux00 quux00 left a comment

Choose a reason for hiding this comment

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

Minor nit left on code comments and request to remove the changes to SearchResponseMerger (communicated via DM). After that I think I can approve.

int totalShards = numShards + numSkippedShards;

// Ensure that given partial results from shard searches, the result we send to the listeners does not contain partial results
// because partialResultsSupressed is set to true. Passing partialResultsSupressed set to true in the assertCompletionListeners
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: "partialResultsSupressed" is misspelled twice here and in the comments below.

Copy link
Copy Markdown
Contributor

@quux00 quux00 left a comment

Choose a reason for hiding this comment

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

LGTM

@chrisparrinello chrisparrinello merged commit 6fc5e7b into elastic:main Feb 17, 2026
35 checks passed
chrisparrinello added a commit that referenced this pull request Feb 23, 2026
…ts (#142875)

Change from partial_results to return_intermediate_results

#141073 introduced a new query parameter to allow clients to decide whether or not intermediate results should be returned when getting async search results if the query is not complete. The initial Github issue asked for a partial_results query parameter but it was decided to change it to return_intermediate_results. That change was made in the PR in all places except for RestGetAsyncSearchAction. This PR corrects that oversight.
jdconrad pushed a commit to jdconrad/elasticsearch that referenced this pull request Feb 24, 2026
…ts (elastic#142875)

Change from partial_results to return_intermediate_results

elastic#141073 introduced a new query parameter to allow clients to decide whether or not intermediate results should be returned when getting async search results if the query is not complete. The initial Github issue asked for a partial_results query parameter but it was decided to change it to return_intermediate_results. That change was made in the PR in all places except for RestGetAsyncSearchAction. This PR corrects that oversight.
sidosera pushed a commit to sidosera/elasticsearch that referenced this pull request Feb 24, 2026
…ts (elastic#142875)

Change from partial_results to return_intermediate_results

elastic#141073 introduced a new query parameter to allow clients to decide whether or not intermediate results should be returned when getting async search results if the query is not complete. The initial Github issue asked for a partial_results query parameter but it was decided to change it to return_intermediate_results. That change was made in the PR in all places except for RestGetAsyncSearchAction. This PR corrects that oversight.
@chrisparrinello chrisparrinello deleted the delay_partial_results branch April 3, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>enhancement :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow delaying partial results in GET /_async_search/{id}

6 participants