Counting parents in a parent child relationship

I am attempting to count profiles based on the has_child filter but I am
not getting the desired results. If I execute the query against the search
api, I get the correct list of documents, but If i execute against the
count api, I get 0.

My end goal is to count profiles which have certain attributes(like male)
and has a child document that matches a certain tag. That should be
possible correct?

Thanks for a really cool product

--

Hi Todd,

Executing the has_child query (and also top_children query) on the
count api has known problems.

The workaround for this problem is the use the search api with the
search type 'count':

In general it is recommended to use the search api with search type
count over the count api for counting hits.

Martijn

On 17 September 2012 22:58, Todd Gruben tgruben@gmail.com wrote:

I am attempting to count profiles based on the has_child filter but I am not
getting the desired results. If I execute the query against the search api,
I get the correct list of documents, but If i execute against the count api,
I get 0.

My end goal is to count profiles which have certain attributes(like male)
and has a child document that matches a certain tag. That should be
possible correct?

Issue with Parent Child counting · GitHub

Thanks for a really cool product

--

--
Met vriendelijke groet,

Martijn van Groningen

--