Understanding Index Stats API Better

Hi Guys,

I am trying to understand Index Stats API better here. I have two indices,
both with the same data. However, the mappings differ. One of them has some
fields that have type as nested. Now the number of documents shown in the
Index Stats API response for the one that has nested type fields is more
than the one that does not have nested type fields. Although when I do a
GET /INDEX_NAME/_search?search_type=count for both the indices, I get the
same count in the response.

Does this mean that Index Stats API is counting nested documents separately?

Would appreciate some clarification on this.

Thanks,
Vaidik Kapoor
vaidikkapoor.info

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CACWtv5kKM7Y255tEVyvfZAfYryx91%2BYk0rBPY7SrMV2YcnN7Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

Yes, nested documents are separate lucene documents, that are never
returned (for now) by the ordinary elasticsearch search apis as they are
filtered out by default. Only a single document gets returned (and
counted), which contains both parent and nested docs. On the lucene index
you have though separate docs stored on the same block.

The _stats api reads the number of documents from lucene (including
nested), while the count and search apis execute a query and filter the
nested docs out.

Hope this clarifies things

On Friday, January 17, 2014 2:53:56 PM UTC+1, Vaidik Kapoor wrote:

Hi Guys,

I am trying to understand Index Stats API better here. I have two indices,
both with the same data. However, the mappings differ. One of them has some
fields that have type as nested. Now the number of documents shown in
the Index Stats API response for the one that has nested type fields is
more than the one that does not have nested type fields. Although when I do
a GET /INDEX_NAME/_search?search_type=count for both the indices, I get the
same count in the response.

Does this mean that Index Stats API is counting nested documents
separately?

Would appreciate some clarification on this.

Thanks,
Vaidik Kapoor
vaidikkapoor.info

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f9fc4f87-8c65-4ece-9399-0264ded57985%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Thanks for the clarification Luca! :slight_smile:

Vaidik Kapoor
vaidikkapoor.info

On 18 January 2014 00:17, Luca Cavanna cavannaluca@gmail.com wrote:

Yes, nested documents are separate lucene documents, that are never
returned (for now) by the ordinary elasticsearch search apis as they are
filtered out by default. Only a single document gets returned (and
counted), which contains both parent and nested docs. On the lucene index
you have though separate docs stored on the same block.

The _stats api reads the number of documents from lucene (including
nested), while the count and search apis execute a query and filter the
nested docs out.

Hope this clarifies things

On Friday, January 17, 2014 2:53:56 PM UTC+1, Vaidik Kapoor wrote:

Hi Guys,

I am trying to understand Index Stats API better here. I have two
indices, both with the same data. However, the mappings differ. One of them
has some fields that have type as nested. Now the number of documents
shown in the Index Stats API response for the one that has nested type
fields is more than the one that does not have nested type fields. Although
when I do a GET /INDEX_NAME/_search?search_type=count for both the
indices, I get the same count in the response.

Does this mean that Index Stats API is counting nested documents
separately?

Would appreciate some clarification on this.

Thanks,
Vaidik Kapoor
vaidikkapoor.info

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/f9fc4f87-8c65-4ece-9399-0264ded57985%40googlegroups.com
.
For more options, visit https://groups.google.com/groups/opt_out.

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CACWtv5mNg2Rm%2BjFOUGn7708gkHNYvty6xdCNp6BE%2Bt1BFwjF8w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.