在php中利用Elasticsearch客戶端。 如何在ES中找到很多文檔,因爲id等於SQL中的「WHERE id IN(1,2,3,4,9)」? 對於單聲道得到我這樣做Multy如何獲得Elasticsearch php的樣本?
$ params = [
'index' => 'my_index',
'type' => 'my_type',
'id' => 'my_id'
];
$ response = $ client-> get ($ params);
如何讓一些唱片嗎? 我試了,但它不工作
$ params = [[
'index' => 'my_index',
'type' => 'my_type',
'id' => 'my_id'
]
[
'index' => 'my_index',
'type' => 'my_type',
'id' => 'my_id2'
]];
$ response = $ client-> mget ($ params);
等
$ params = [
'index' => 'my_index',
'type' => 'my_type',
'id' => array ('my_id', 'my_id2')
];
$ response = $ client-> mget ($ params);
的API是PHP只有HTTPS:https://www.elastic.co/guide/en/elasticsearch/client/php-api/2.0/_getting_documents.html
這樣了,只CURL請求HTTPS:https://www.elastic.co/guide/en/elasticsearch/reference/1.4/docs-multi-get.html
誰與ES合作過,請幫忙!)
你有機會嘗試一下嗎? – Val
但爲什麼不是mget的工作。它應該與'文檔'鍵合作嗎? https://www.elastic.co/guide/en/elasticsearch/guide/current/_retrieving_multiple_documents.html –
我已經更新了我的答案。 – Val