I am using following code to get count of records indexed which satisfy the given criteria, but this is not working and giving me all the records indexed in the type. How do I get count of records satisfying the criteria.
SearchRequestBuilder searchRequest = client.prepareSearch(indexName);
SearchResponse response = searchRequest.setSource(new SearchSourceBuilder().size(10000).query(QueryBuilders.queryStringQuery(queryString).get();
The above code is not working in Elasticsearch 5 Java client api, please help.