Aggregate doc_counts of matched nested objects

(John) #1

I would like to know how many of my documents have X number of matching nested objects.

This is a similar document to what I'm working with. In reality they have many more attributes:

{ "title": "Example", "events": [ { "id": "event-1", "timestamp": "2015-10-10T10:10:10" }, { "id": "event-2", "timestamp": "2015-11-11T11:11:11" } ] }

I have millions of documents and each document have 0-50 (could be even more) nested objects (events).

I'm filtering such that I only want the nested objects that fall within a certain date range. I then would like to know how many of the docs have 1, 2, 3, 4.. (and so on) matching nested objects. Is this possible? I'm using ES 2.0.

(Adrien Grand) #2

Unfortunately I don't think this is something that can be done.

(system) #3