Help in query approach needed

Hi All,

I have a sample data in my index as below

{ "id": 1, "doc": "d1" }
{ "id": 2, "doc": "d1", "event": "e1" }
{ "id": 3, "doc": "d1", "event": "e2" }
{ "id": 4, "doc": "d2", "event": "e1" }
{ "id": 5, "doc": "d2", "event": "e3" }
{ "id": 6, "doc": "d3" }

I need to find out the count of unique events + count of docs which has no events associated with it in any documents. Just to explain further the answer expected is 4 where there are three unique events e1,e2,e3 and one document d3 which has no event associated with it. Here document with id1 which has d1 as "doc" value should not be considered as d1 has some event associated with it some other docs like doc with id3, id2

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.