Muh*_*zan 2 javascript elasticsearch
我试图找到在弹性搜索中按ID查找的最常见用法。
按ID查找: 以弹性搜索方式
GET /myindex/mytype/1
Run Code Online (Sandbox Code Playgroud)
按ID查找:使用javascript客户端进行elasticSearch
client.get({
index: 'myindex',
type: 'mytype',
id: 1
}, function (error, response) {
// ...
});
Run Code Online (Sandbox Code Playgroud)
通过ID查找: 以弹性搜索方式
GET /_search
{
"query": {
"ids" : {
"type" : "my_type",
"values" : ["1", "4", "100"]
}
}
}
Run Code Online (Sandbox Code Playgroud)
按ID查找:使用javascript客户端进行elasticSearch
client.search({
index: 'myindex',
body: {
query: {
ids: {
type : "my_type",
values : ["1", "4", "100"]
}
}
},
}, function (error, response) {
// handler responses here
});
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2282 次 |
| 最近记录: |