ES数据库排序查询:sort

ES数据库排序查询:sort

降序:desc
POST gr_group_tg/_search
{
    
    
  "query": {
    
    
      "range":{
    
    
          "@timestamp":{
    
    
              "gt": "2020-12-24T01:51:12.626Z"
          }
      }
  },
  "sort": [
      {
    
    
          "@timestamp": {
    
    
              "order": "desc"
          }
      }
  ]
}
升序:asc
POST gr_group_tg/_search
{
    
    
  "query": {
    
    
      "range":{
    
    
          "@timestamp":{
    
    
              "gt": "2020-12-24T01:51:12.626Z"
          }
      }
  },
  "sort": [
      {
    
    
          "@timestamp": {
    
    
              "order": "asc"
          }
      }
  ]
}

猜你喜欢

转载自blog.csdn.net/msq16021/article/details/113141527