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 [email protected]. 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.
