# Word Frequency for search term

**URL:** <https://discuss.elastic.co/t/word-frequency-for-search-term/228332>\
**Category:** Elasticsearch\
**Created:** [April 16, 2020, 1:44pm UTC](https://discuss.elastic.co/t/word-frequency-for-search-term/228332 "2020-04-16T13:44:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sanjaye218](https://avatars.discourse-cdn.com/v4/letter/s/c89c15/32.png) [@sanjaye218](https://discuss.elastic.co/u/sanjaye218)\
**Post date:** [April 16, 2020, 1:44pm UTC](https://discuss.elastic.co/t/word-frequency-for-search-term/228332/1 "2020-04-16T13:44:26Z")

</div>

Hi,  
I am trying to find word frequency suing query string. But in case search term is more than single word and field is of type text, then its returning incorrect results.  
Like if my data is "This is word tied off" and with below query, its searching tied off as tied and off separately, returning doc.freq as 1 for tied and 1 for off, so total 2 for this document. I am expecting doc.freq as 1 as tied off matches one time.

"query": {  
"bool": {  
"must": [  
{  
"query\_string": {  
"query": ""tied off"",  
"fields": [  
"comments"  
]  
}  
}  
]  
}  
}

---

<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:** [May 14, 2020, 1:46pm UTC](https://discuss.elastic.co/t/word-frequency-for-search-term/228332/2 "2020-05-14T13:46:34Z")

</div>

Closed on May 14, 2020, 1:46pm UTC

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