RestHighLevelClient Elastic Search Java Client takes more time for Search Query

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"
      }
      }
      ]

      }

Welcome

What is the difference we are talking about. Could you share some numbers?

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.