elastic / elasticsearch-rs

Official Elasticsearch Rust Client
https://www.elastic.co/guide/en/elasticsearch/client/rust-api/current/index.html
Apache License 2.0
702 stars 72 forks source link

[ENHANCEMENT] Scroll API helper functions #63

Open russcam opened 4 years ago

russcam commented 4 years ago

Similar to #62, The scroll API can be used to retrieve a large number of documents from Elasticsearch by issuing a search request with the scroll parameter, and using the scroll_id returned in a response to fetch the next batch of documents with a search request, continuing until all documents are retrieved.

Many of the existing Elasticsearch clients provide a "scroll helper" for this purpose. The helper can issue a search request, and continue to issue search requests until all documents are retrieved. The scroll can be sliced, allowing concurrent scrolls to be executed.

The Rust client should provide a similar, idiomatic way of helping consumers retrieve a large collection of documents.