We have a use-case where we are querying elastic for an unknown number of results, with very aggressive latency requirements.
In 99 percentile of scenarios, the result-set < page size. In <= 1 percentile, the results may be > page size. Since we need to return all results in one go, without pagination, does it make sense to use scrolling for all requests, even though it will be used very rarely? Or does it make sense for < 1 percentile scenarios, to make subsequent standalone requests to collect all the results before returning the result set?
Is there any initial overhead to initiating a scroll session?
I see the documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-scroll.html mentions Scrolling is not intended for real time user requests, but rather for processing large amounts of data, e.g. in order to reindex the contents of one index into a new index with a different configuration. But in general will the performance be detrimental if scrolling-sessions are initiated for all requests?