12.ES|scroll_search API

Elasticsearchでの検索時、オプションに何も指定しなければ10件までしか取得されない。
オプションでsizeを指定すると件数を増やせるが、最大でも10,000件までとなる。

10,000件を超えるデータを取得する際は、scroll_search APIで何回かに分けて取得することになる。

Execute A Query With The Scroll-Search API.

The scroll-search API works by returning a 'token' to the user that allows search results to be returned one 'page' at a time. This, large query results (in excess of the 10,000 documents maximum size offered by the from-search API) can be retreived by making multiple calls after the initial query was sent. Although a slower process end-to-end, this API is particularly well suited to returning large query results.

  • 書き方
scroll_search(rescource, api_call_payload,
  extract_function = extract_query_results)

※詳細は下記サイト参照。