# Get occurrence of each word in all documents

**URL:** https://discuss.elastic.co/t/get-occurrence-of-each-word-in-all-documents/212468
**Category:** Elasticsearch
**Created:** [December 19, 2019, 10:49am UTC](https://discuss.elastic.co/t/get-occurrence-of-each-word-in-all-documents/212468 "2019-12-19T10:49:02Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![inqom](https://avatars.discourse-cdn.com/v4/letter/i/7feea3/32.png) [@inqom](https://discuss.elastic.co/u/inqom)
#### Post date: [December 19, 2019, 10:49am UTC](https://discuss.elastic.co/t/get-occurrence-of-each-word-in-all-documents/212468/1 "2019-12-19T10:49:03Z")

</div>

I have a list of words. Let's say ["House","Door"].  
I want for each word get the number of documents where this word occurs. I prefer to use only one query as my list can be huge.

The response could be like this :

{  
"House":5,  
"Door": 10,  
}

Is there a way to do this with ElasticSeatch ?

---

<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: [January 16, 2020, 10:49am UTC](https://discuss.elastic.co/t/get-occurrence-of-each-word-in-all-documents/212468/2 "2020-01-16T10:49:06Z")

</div>

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