RestHighLevelClient is taking more time for Search Queries and have bad performance.From direct Elastic Search Rest API it is taking less time.
How can we optimise the performance for this search request
This is the Code Snippet :
SearchRequest searchRequest=new SearchRequest(new String[]
{indexName},searchSourceBuilder);
searchSourceBuilder.trackTotalHits(true);
searchResponse =restHighLevelClient.search(searchRequest, RequestOptions.DEFAULT);
Query created using BoolQueryBuilder:
{
"size": 100,
"query": {
"bool": {
"filter": [
{
"range": {
"date": {
"from": "2017-08-01T00:00:00.000Z",
"to": "2017-08-30T00:00:00.000Z",
"include_lower": true,
"include_upper": true,
"boost": 1
}
}
}
],
"adjust_pure_negative": true,
"boost": 1
}
},
"sort": [
{
"date": {
"order": "desc"
}
},
{
"id": {
"order": "desc"
}
}
]
}