title: How to get total result count when setFrom is used in elasticsearch QueryBuilders?
body: <p>I am creating pagination using elasticsearch QueryBuilders. I am using setFrom to get limited results for pagination. but I need total result count to create total page links in pagination as per result. How can i get total count before setFrom is applied to query? or I have to write same query again to get total count without setFrom and size?</p>
  
  <p>this is my query</p>
  
  <pre><code>BoolQueryBuilder query = QueryBuilders.boolQuery();
  for (String key : brands) {
      query.must(QueryBuilders.matchQuery("brand", key));
  }
  
  // search term
  query.must(QueryBuilders.queryStringQuery(pSearchTerm + "*")
          .lenient(true).field("name"));
  
  // price range
  query.filter(QueryBuilders.rangeQuery("unit_price").from(min)
          .to(max));
  
  SearchResponse searchresponse = client.prepareSearch("product")
          .setTypes("product").setQuery(query).setFrom(from).setSize(20)
          .setExplain(true).execute().actionGet();
  
  SearchHit[] results = searchresponse.getHits().getHits();
  </code></pre>