# Eliminate query terms based on their document frequency!

**URL:** <https://discuss.elastic.co/t/eliminate-query-terms-based-on-their-document-frequency/22250>\
**Category:** Elasticsearch\
**Created:** [February 18, 2015, 9:06pm UTC](https://discuss.elastic.co/t/eliminate-query-terms-based-on-their-document-frequency/22250 "2015-02-18T21:06:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![krishna](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@krishna](https://discuss.elastic.co/u/krishna)\
**Post date:** [February 18, 2015, 9:06pm UTC](https://discuss.elastic.co/t/eliminate-query-terms-based-on-their-document-frequency/22250/1 "2015-02-18T21:06:09Z")

</div>

Hi,

How can we configure elastic search to eliminate query terms specific to  
field based on document frequency threshold?

for eg: for query "_title_:test AND _title_:west AND _desc_:world AND  
_desc_:hello"  
Assume document frequency threshold is set to 10 and few terms in the query  
i.e,\* desc\*:world and _title_:test have document frequency greater than 10,  
i.e query should be changed to "_title_:west AND _desc_:hello".

one approach is to query for each terms in the and based on retrieved  
document count eliminate such terms exceeding the given document frequency  
threshold, but this is not effective as it increases number of searches  
drastically!

--  
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/52efe61d-2e5d-40d3-9666-adf155496c33%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/52efe61d-2e5d-40d3-9666-adf155496c33%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![krishna](https://avatars.discourse-cdn.com/v4/letter/k/71c47a/32.png) [@krishna](https://discuss.elastic.co/u/krishna)\
**Post date:** [February 19, 2015, 4:48am UTC](https://discuss.elastic.co/t/eliminate-query-terms-based-on-their-document-frequency/22250/2 "2015-02-19T04:48:08Z")

</div>

anyone have idea on above stuff ?

On Thursday, 19 February 2015 02:36:09 UTC+5:30, sri krishna wrote:

> Hi,
> 
> How can we configure Elasticsearch to eliminate query terms specific to  
> field based on document frequency threshold?
> 
> for eg: for query "_title_:test AND _title_:west AND _desc_:world AND  
> _desc_:hello"  
> Assume document frequency threshold is set to 10 and few terms in the  
> query i.e,\* desc\*:world and _title_:test have document frequency greater  
> than 10, i.e query should be changed to "_title_:west AND _desc_:hello".
> 
> one approach is to query for each terms in the and based on retrieved  
> document count eliminate such terms exceeding the given document frequency  
> threshold, but this is not effective as it increases number of searches  
> drastically!

--  
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/8cdc00a9-6ec1-4f95-84dc-3c4477bafd27%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8cdc00a9-6ec1-4f95-84dc-3c4477bafd27%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/eliminate-query-terms-based-on-their-document-frequency/22250/3 "2017-07-06T00:31:40Z")

</div>


