# Limit a document frequency in elasticsearch

**URL:** <https://discuss.elastic.co/t/limit-a-document-frequency-in-elasticsearch/66394>\
**Category:** Elasticsearch\
**Created:** [November 17, 2016, 1:22pm UTC](https://discuss.elastic.co/t/limit-a-document-frequency-in-elasticsearch/66394 "2016-11-17T13:22:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![banu](https://avatars.discourse-cdn.com/v4/letter/b/2acd7d/32.png) [@banu](https://discuss.elastic.co/u/banu)\
**Post date:** [November 17, 2016, 1:22pm UTC](https://discuss.elastic.co/t/limit-a-document-frequency-in-elasticsearch/66394/1 "2016-11-17T13:22:10Z")

</div>

While executing the query it takes above 50 milliseconds to fetch the results. For other search results it takes only below 50 milliseconds. When removing the norm\_biznme the query response is faster. How to limit the frequency for this field alone ?

{"explain": true, "size":25, "query":{"query\_string":{"query":"( ((norm\_biznme:"TEST") AND (city\_key:"TEST\_CITY"))^40 OR (zip\_key:"00 0") ^6 OR (norm\_biznme\_exct:"TEST")^50 OR (phone\_key:"")^50 OR ((physicalAddresses.streetNumber:"5") AND (physicalAddresses.streetName:"new"))^15 OR (tradeStyles.acronym:"ASD")^5 OR (mailAddresses.poBox:"00 0")^6 OR (norm\_biz\_nme\_word\_pair: "TEST")^30 OR (norm\_biz\_nme\_sdx: "TEST")^5 OR (ceoName:"TEST")^30 OR ((physicalAddresses.streetName:"new") AND (city\_key:"TEST\_CITY")))" }}, "sort":[{"\_score":{"order":"desc"}}],"aggs":{"exctNme":{"filter":{"term":{"norm\_biznme\_exct":"{{TEST}}"}}}}}

---

<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:** [December 15, 2016, 1:23pm UTC](https://discuss.elastic.co/t/limit-a-document-frequency-in-elasticsearch/66394/2 "2016-12-15T13:23:15Z")

</div>

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