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

**URL:** https://discuss.elastic.co/t/is-this-a-right-way-to-find-in-nested-type-that-a-user-has-four-time-done-event-e1-and-has-not-done-event-e2/22293
**Category:** Elasticsearch
**Created:** [February 20, 2015, 1:50pm UTC](https://discuss.elastic.co/t/is-this-a-right-way-to-find-in-nested-type-that-a-user-has-four-time-done-event-e1-and-has-not-done-event-e2/22293 "2015-02-20T13:50:49Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sandeep\_kaushal\_verm](https://avatars.discourse-cdn.com/v4/letter/s/4491bb/32.png) [@sandeep\_kaushal\_verm](https://discuss.elastic.co/u/sandeep_kaushal_verm)
#### Post date: [February 20, 2015, 1:50pm UTC](https://discuss.elastic.co/t/is-this-a-right-way-to-find-in-nested-type-that-a-user-has-four-time-done-event-e1-and-has-not-done-event-e2/22293/1 "2015-02-20T13:50:49Z")

</div>

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](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/429a50a3-7abc-452e-9035-ca580156031c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/429a50a3-7abc-452e-9035-ca580156031c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 12:31am UTC](https://discuss.elastic.co/t/is-this-a-right-way-to-find-in-nested-type-that-a-user-has-four-time-done-event-e1-and-has-not-done-event-e2/22293/2 "2017-07-06T00:31:12Z")

</div>


