es定制排序搜索结果

时间:2022-09-27 13:35:28

GET /company/employee/_search
{
  "query": {
    "constant_score": {
      "filter": {
        "range": {
          "age": {
            "gte": 30
          }
        }
      }
    }
  },
  "sort": [{
    "join_date": {
      "order": "asc"
    }
  }]
}