在我的索引之一中,我有80000个文档。我试图一次获得所有数据。上限为10000个数据。
如何通过php一次获取所有80000条记录?
我指的是此URL https://packagist.org/packages/elasticsearch/elasticsearch
$params = [
"scroll" => "30s",
"size" => 10000,
"index" => $stdIndex,
'type' => $stdIndexType];
$response = $client->search($params);
while (isset($response['hits']['hits']) && count($response['hits']['hits']) > 0) {
$scroll_id = $response['_scroll_id'];
$response = $client->scroll([
"scroll_id" => $scroll_id,
"scroll" => "30s"]
);
}