7

ES 1.7.3

We have around 20M documents. Each document has a unique ID. When we do a count-request (/index/type/_count) we get around 30K less documents than we indexed.

I checked the existence of each document by making requests on the ID field. Result: there is none missing.

Is there any reasons why _count returns not the exact count?

PS: I read about estimates when doing aggregations. Is this perhaps related?

1 Answer 1

7

Coutn API may result in inaccurate results. You can use search_type=count instead. It works in the same way as searching works but returns only count.

Use it like

GET /index/type/_search?search_type=count

Study more about search_type here.

You can also refer to this question

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.