ES0.16的版本,对ID字段做了调整,默认不会对其进行索引,所以对_id做查询和排序都将不起作用。 如下面的操作: 查询
curl -XPOST http://localhost:9200/index/type/1-d'{a:1}'
curl -XPOST http://localhost:9200/index/type/2-d'{a:1}'
curl http://localhost:9200/index/type/_search?q=_id:*
{"took":15,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
http://localhost:9200/index/type/_search?q=_id:1&sort=_id:desc


