Get Request with raw JSON as a filter

眉间皱痕 提交于 2019-12-11 16:02:54

问题


I want to make a HTTP GET request to a not local elasticSearch and use this filter:

    {
"query": { 
    "bool": { 
      "filter": [ 
        { "range": { "timestamp": { "gte": "2019-08- 09T06:00:00","lt":"2019-08-09T08:00:00"}}} 
      ]
    }
  }
}

but I don't know how to put this filter in the restTemplate.getForEntity request.

The request in Kotlin is something like this:

val forEntity_Flow= 
restTemplate.getForEntity("https://X.X.X.X:6200/bla_bal-${da}/_search/? 
size=50&pretty=1", ResultsBla::class.java)

How can I put that postman query in Kotlin code. Thank you for the help!

来源:https://stackoverflow.com/questions/57433649/get-request-with-raw-json-as-a-filter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!