The ask
We would like a way to signal to Elasticsearch not to return partial results before an async search is completed, so that we can efficiently use the GET /_async_search/{id} endpoint for long-polling.
The why
After creating an async search, Kibana currently uses the async status endpoint /_async_search/status/{id} for polling. The reason is that if we use GET /_async_search/{id}, we will always receive partial results if they are available. Partial results are not used in the UI prior to search completion and they introduce overhead during polling.
However, using the status endpoint has two main drawbacks
- it doesn't support long-polling (
wait_for_completion_timeout)
- it requires us to make two requests to detect a finished search and then load results
This limitation, together with our polling backoff strategy, creates a delay (up to the length of the polling interval) between when an async search is completed, and when the results are delivered to the client.
In practical terms, this means that every panel on a dashboard is being unnecessarily slowed down.
This enhancement will allow results to be delivered to the client as soon as they are ready.
Visuals
Today
The proposal

The ask
We would like a way to signal to Elasticsearch not to return partial results before an async search is completed, so that we can efficiently use the
GET /_async_search/{id}endpoint for long-polling.The why
After creating an async search, Kibana currently uses the async status endpoint
/_async_search/status/{id}for polling. The reason is that if we useGET /_async_search/{id}, we will always receive partial results if they are available. Partial results are not used in the UI prior to search completion and they introduce overhead during polling.However, using the status endpoint has two main drawbacks
wait_for_completion_timeout)This limitation, together with our polling backoff strategy, creates a delay (up to the length of the polling interval) between when an async search is completed, and when the results are delivered to the client.
In practical terms, this means that every panel on a dashboard is being unnecessarily slowed down.
This enhancement will allow results to be delivered to the client as soon as they are ready.
Visuals
Today
The proposal