Release notes:
- es version 7.16.3 version
- es query java es-client maven version 6.8.0/6.8.6
When querying es data, the total number of query response.getHits().getTotalHits() is always 0
amendment:
- The version of the es version api is correspondingly upgraded to 7.16.3
- Query by es CountRequest, CountRequest(indexName,queryBuilder)
Let me talk about the reason, the guess is that the data structure returned by the es version upgrade has changed.
reference blog
When ES queries, the result of getting the total items through response.getHits().getTotalHits() is always 0
One of the above blog solutions does not work, even after upgrading the version:
- ES-Client uses version 6.8.3: response.getHits().getTotalHits()