Understanding Index Stats API Better

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Understanding Index Stats API Better

vaidik
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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Understanding Index Stats API Better

Luca Cavanna
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
<a href="http://vaidikkapoor.info" target="_blank" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fvaidikkapoor.info\46sa\75D\46sntz\0751\46usg\75AFQjCNH5zKfq-xDwNXP5NRZ6kj1jIUZ_Iw';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fvaidikkapoor.info\46sa\75D\46sntz\0751\46usg\75AFQjCNH5zKfq-xDwNXP5NRZ6kj1jIUZ_Iw';return true;">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 [hidden email].
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.
Reply | Threaded
Open this post in threaded view
|

Re: Understanding Index Stats API Better

vaidik
Thanks for the clarification Luca! :)

Vaidik Kapoor
vaidikkapoor.info


On 18 January 2014 00:17, Luca Cavanna <[hidden email]> 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 [hidden email].
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 [hidden email].
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.