Is this a right way to find in nested type that a user has done event e1 and has not done event e2?

Below is Mapping of type user with nested event
{
"beta":{
"mappings":{
"user":{
"dynamic_templates":[
{
"string_template":{
"mapping":{
"type":"string",
"index":"analyzed",
"analyzer":"string_lowercase"
},
"match":"*",
"match_mapping_type":"string"
}
}
],
"_routing":{
"required":true,
"path":"_shardId"
},
"properties":{
"event":{
"type":"nested",
"properties":{
"_date":{
"type":"date",
"format":"dateOptionalTime"
},
"count":{
"type":"long"
},
"first_date":{
"type":"date",
"format":"dateOptionalTime"
},
"name":{
"type":"string",
"analyzer":"string_lowercase"
},
"last_date":{
"type":"date",
"format":"dateOptionalTime"
}
}
}
}
}
}
}
}

--
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/4a7e4ece-6b04-427f-b186-b44b98ed2a4b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.