$batch = $this->esType->body(["_source" => ["_id"]])->scroll("5m")->take(10000)->get();
After trying what I could and looking at source code, I found in var_dump($batch) named scroll id scrollId
instead of scroll_id
and it is a protected variable. Correct way to get it turned out to be:
$scrollId = $batch->getScrollId();
The following queries to get next and next 10000 items then would be:
$batch = $this->esType->body(["_source" => ["_id"]])->scroll("5m")->scrollID($scrollId)->get();