As part of the effort to minimize the server-side processing of search responses from Elasticsearch, we need to move the handling of retrieveResults to the client.
Background:
In https://github.com/elastic/kibana/pull/179679, we added the ability to display partial results of a long-running search request when it times out (search:timeout advanced setting). When the timeout is hit, prior to sending the DELETE _async_search/{id} request, we send one final request to ES (GET _async_search/{id}). (This is because we poll on the status endpoint GET _async_search/status/{id}, which doesn't perform the merging/calculation on ES side for the most up-to-date results of the specific async search request.)
In order to accomplish this, we added a parameter, retrieveResults, which the client sends to the server-side search strategy, which will bypass the logic that polls on the status endpoint and call the GET _async_search/{id} request directly. Since we are trying to move to a place where we can directly stream the responses back from ES to the browser, we need to move this handling to the client.
Summary:
As part of the effort to minimize the server-side processing of search responses from Elasticsearch, we need to move the handling of
retrieveResults
to the client.Background:
In https://github.com/elastic/kibana/pull/179679, we added the ability to display partial results of a long-running search request when it times out (
search:timeout
advanced setting). When the timeout is hit, prior to sending theDELETE _async_search/{id}
request, we send one final request to ES (GET _async_search/{id}
). (This is because we poll on the status endpointGET _async_search/status/{id}
, which doesn't perform the merging/calculation on ES side for the most up-to-date results of the specific async search request.)In order to accomplish this, we added a parameter,
retrieveResults
, which the client sends to the server-side search strategy, which will bypass the logic that polls on the status endpoint and call theGET _async_search/{id}
request directly. Since we are trying to move to a place where we can directly stream the responses back from ES to the browser, we need to move this handling to the client.