Count number for nested array objects


(aiayumi) #1

Hi,

I was wondering if there's a way return count based on the number of nested
array items, instead of Document count.

e.g:

So if I have something like this:

obj : {
array : [{
id: 1,
group: A
},
{
id: 2,
group: A
},
{
id: 3,
group: B
}]
}

And I want to count number of items with group=A, it should return 2,
instead of 1 (the Doc count)

Is there a way of doing this?

Thanks

--
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/794e544a-f494-4c3e-b2ba-10069bce9a26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2