- Newest
- Most votes
- Most comments
Syntax for scroll request: GET _search/scroll/<scroll-id>
https://opensearch.org/docs/latest/opensearch/rest-api/scroll/
When running the scroll request for the first time, we use the index name. Below is an example:
GET shakespeare/_search?scroll=10m { "size": 10000 }
This will return scroll id:
"_scroll_id" : "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAUWdmpUZDhnRFBUcWFtV21nMmFwUGJEQQ=="
From the second time use only _search/scroll/<scrollid>. we don't pass index name the second time
sample: GET _search/scroll { "scroll": "10m", "scroll_id": "DXF1ZXJ5QW5kRmV0Y2gBAAAAAAAAAAUWdmpUZDhnRFBUcWFtV21nMmFwUGJEQQ==" }
Note: Once the scroll id expires, scroll request will start failing. Please consider starting a new scroll.
params = {"size": 5000, "q": query, "scroll": "5m"} resp = requests.get(ELASTICSEARCH_URL + "/_search", params=params, auth=auth) resp.status code: 200 scroll_id = resp.json().get("_scroll_id")
Above Query works fine on versions 7.10, 7.9, 7.7 and 7.4. Since python says illegal argument exception, version of ES/OS is required to replicate the issue using the same python client.
Relevant content
- asked 2 months ago
- asked 9 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 3 years ago