As documentation explain you need to make the first call using
GET /old_index/_search?search_type=scan&scroll=1m
{
"query": { "match_all": {}},
"size": 1000
}
The response to this request doesn’t include any hits (means content you search) but scroll id like following
{
"_scroll_id" : "c2Nhbjs1OzMwNTYzMTkxNjpTSkM2S0cxVFJIeUk1NnZWbGFUV1FnOzMwNTYzMTkxNTpTSkM2S0cxVFJIeUk1NnZWbGFUV1FnOzMwNTYyMjEwNzp4OEkwZE54eVR0cXI4cHAzU2I5UmlBOzMwNTYzNTE0NjpQZEhCSUZXeFJZU3daaDJKZXZCRmh3OzMwNTY0OTg4OTphdEE1OTN2NFFsYVY5ZjJ4SUxuVFpROzE7dG90YWxfaGl0czoyOTIwOw==",
"took" : 10,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 2920,
"max_score" : 0,
"hits" : []
}
}
After this you can use normal call with the scroll_id
GET /_search/scroll?scroll=1m&_scroll_idc2Nhbjs1OzMwNTYzMTkxNjpTSkM2S0cxVFJIeUk1NnZWbGFUV1FnOzMwNTYzMTkxNTpTSkM2S0cxVFJIeUk1NnZWbGFUV1FnOzMwNTYyMjEwNzp4OEkwZE54eVR0cXI4cHAzU2I5UmlBOzMwNTYzNTE0NjpQZEhCSUZXeFJZU3daaDJKZXZCRmh3OzMwNTY0OTg4OTphdEE1OTN2NFFsYVY5ZjJ4SUxuVFpROzE7dG90YWxfaGl0czoyOTIwOw==
_scroll_id can be in request or body