Get Request with raw JSON as a filter

2019-08-23 05:32发布

问题:

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!