I am migrating a java application from elastic search high level client to java api client.
There is a range query like this in the code.
QueryBuilders.rangeQuery("startDate").lte(dateUtils.today())
Need to change this to java api client code.
Could someone help on this?
2 Answers
https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/current/searching.html
Query dateRangeQuery = RangeQuery.of(r -> r
.field("startDate")
.lte(dateUtils.today())
)._toQuery();
1 Comment
Community
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.