Max_docs and count api does not return the same number

I have a ES cluster with 2 nodes (v0.20.2). I built a new index with 609218
docs without any error (every doc was inserted just once). Then I have this
returned from status:

docs: {
num_docs: 876969
max_doc: 876969
deleted_docs: 0
}

while the count API returns the 609218 docs:

curl http://es_node:9200/my_index/my_type/_count
{"count":609218,"_shards":{"total":5,"successful":5,"failed":0}}

And my index settings look like this:
settings: {
index.number_of_replicas: 1
index.version.created: 191199
index.number_of_shards: 5
}

Why does num_docs show different than 609218? I am also not sure why
"index.version.created: 191199" as my docs have no version changes.

Thanks,

Chunlei

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

On Wed, 2013-01-30 at 11:41 -0800, Chunlei Wu wrote:

I have a ES cluster with 2 nodes (v0.20.2). I built a new index with
609218 docs without any error (every doc was inserted just once). Then
I have this returned from status:

docs: {
num_docs: 876969
max_doc: 876969
deleted_docs: 0
}

while the count API returns the 609218 docs:

Do you use the nested mapping at all? Each nested doc counts as a
separate doc, even though it is not visible to the user.

clint

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Aha, that's exactly right! I do have "nested" type in the mapping file. 87
6969-609218=267751 is the exact number of nested docs.

It's good to know that. Maybe worth mentioning this in "nested type" page.
I was worried if I did the indexing correctly.

Thanks a lot!

Chunlei

On Thursday, January 31, 2013 12:52:45 AM UTC-8, Clinton Gormley wrote:

On Wed, 2013-01-30 at 11:41 -0800, Chunlei Wu wrote:

I have a ES cluster with 2 nodes (v0.20.2). I built a new index with
609218 docs without any error (every doc was inserted just once). Then
I have this returned from status:

docs: {
num_docs: 876969
max_doc: 876969
deleted_docs: 0
}

while the count API returns the 609218 docs:

Do you use the nested mapping at all? Each nested doc counts as a
separate doc, even though it is not visible to the user.

clint

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.