我正在尝试使用PHP API,以及代码中给出的相同示例
$client = ClientBuilder::create()->build();
$params = [
"scroll" => "30s", // how long between scroll requests. should be small!
"size" => 50, // how many results *per shard* you want back
"index" => "my_index",
"body" => [
"query" => [
"match_all" => new \stdClass()
]
]
];
// Execute the search
// The response will contain the first batch of documents
// and a scroll_id
$response = $client->search($params);
但是[滚动]中的VALUE_STRING会收到类似于此未知键的错误。
目前使用Elasticsearch版本6.2.2
有什么想法吗?
答案 0 :(得分:0)
您可能不小心将滚动属性放入正文中。
答案 1 :(得分:0)
问题是您将滚动参数放在json主体中,但应该改为在URL中。例如
index-name/_search?scroll=30s
别忘了也将其从$params
中删除