Inconsistent doc count

We have a 6 node elasticsearch 2.4.4 cluster. Each index has 2 shards and 1 replica. When we call _search?size=10, "total" keeps alternating between 257566/257707 in an index. Expected total count is 257707. When i query _search?size=10&preference=_primary, I get 257707 and when i query _search?size=10&preference=_replica I get 257566.

We are noticing this only when we use delete by query to delete some documents and do indexing again. Below is the call we are making to delete the docs

DeleteByQueryRequestBuilder(client, DeleteByQueryAction.INSTANCE) .setIndices(indexName) .setTypes(mappingName) .setSource(new SearchSourceBuilder().query(QueryBuilders.matchAllQuery()).size(5000).toString()) .execute() .actionGet()

Any theory on why we are getting inconsistent count is really appreciated

Any insights is really appreciated. Is the delete by query operation the way we are doing, is it synchronous and deletes the data from replicas immediately?

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