elasticsearch之分页查询

分页查询: from /size

GET zhifou/doc/_search
{
  "query": {
    "match_all": {}
  },
  "sort": [
    {
      "age": {
        "order": "desc"
      }
    }
  ], 
  "from": 2,   #从排序好的结果第二条开始
  "size": 1     # 返回一条数据
}

相关推荐