code: public long countQuery(SearchRequestBuilder countRequestBuilder,
              long timeoutMillis) {
          countRequestBuilder.setSize(0);
          return searchQuery("countQuery", countRequestBuilder, timeoutMillis)
                  .getHits().getTotalHits();
      }
docs: Count query long.
  
  @param countRequestBuilder the count request builder
  @param timeoutMillis       the timeout millis
  @return the long