# Agregations and filters

**URL:** <https://discuss.elastic.co/t/agregations-and-filters/96008>\
**Category:** Elasticsearch\
**Created:** [August 6, 2017, 10:15am UTC](https://discuss.elastic.co/t/agregations-and-filters/96008 "2017-08-06T10:15:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![SerjGAmoVeR](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/serjgamover/32/45177_2.png) [@SerjGAmoVeR](https://discuss.elastic.co/u/SerjGAmoVeR)\
**Post date:** [August 6, 2017, 10:15am UTC](https://discuss.elastic.co/t/agregations-and-filters/96008/1 "2017-08-06T10:15:32Z")

</div>

I have an index with this mapping:

"domain": {  
"type": "string",  
"index": "not\_analyzed"  
},  
"keyword": {  
"type": "string",  
}

Example data:

{"domain": "[google.com](http://google.com)", "keyword":"search"},  
{"domain": "[google.com](http://google.com)", "keyword":"people"},  
{"domain": "[facebook.com](http://facebook.com)", "keyword":"people"},  
{"domain": "[foo.com](http://foo.com)", "keyword":"bar"},

I want to create a query, that will return:

- domains, filtered by keyword
- total count of keywords resulted domains have

For search "people" it might be "google": 2 and "facebook": 1

Thanks for your help!

---

<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:** [September 3, 2017, 10:15am UTC](https://discuss.elastic.co/t/agregations-and-filters/96008/2 "2017-09-03T10:15:38Z")

</div>

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