欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

es查询语法

程序员文章站 2022-07-06 16:14:55
...

1.select streamId,flowId, dataGeneratedTs,dataProcessTs,doneTs,feedbackTime,rddTs,sinkTs,swiftsTs from wormhole_feedback_2_adx where flowId = 23704 and dataProcessTs >= "2020-12-08 11:00:00.000000+0800" and dataProcessTs <= "2020-12-08 12:00:00.000000+0800" order by dataGeneratedTs desc limit 3

GET /wormhole_feedback_2_adx/_search
{
  "size": 3,
  "_source": {
    "includes": [
      "streamId",
      "flowId", 
      "dataGeneratedTs",
      "dataProcessTs",
      "doneTs",
      "feedbackTime",
      "rddTs",
      "sinkTs",
      "swiftsTs"
    ]
  },
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "flowId": 23704
          }
        },
        {
          "range": {
            "dataProcessTs": {
              "gte": "2020-12-08 11:00:00.000000+0800",
              "lte": "2020-12-08 12:00:00.000000+0800"
            }
          }
        }
      ]
    }
   },
   "sort": [
     {
       "dataGeneratedTs":{
         "order": "desc"
       }
     }
  ]
}

 

相关标签: es elasticsearch