79230627

Date: 2024-11-27 14:13:09
Score: 1
Natty:
Report link
$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();              
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Nikolay kitsul