Muh*_*zan 9

按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)