# Index-per-user required for common terms query and cutoff\_frequency?

**URL:** <https://discuss.elastic.co/t/index-per-user-required-for-common-terms-query-and-cutoff-frequency/23476>\
**Category:** Elasticsearch\
**Created:** [April 29, 2015, 6:53pm UTC](https://discuss.elastic.co/t/index-per-user-required-for-common-terms-query-and-cutoff-frequency/23476 "2015-04-29T18:53:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [April 29, 2015, 6:53pm UTC](https://discuss.elastic.co/t/index-per-user-required-for-common-terms-query-and-cutoff-frequency/23476/1 "2015-04-29T18:53:14Z")

</div>

The docs  
[http://www.elastic.co/guide/en/elasticsearch/guide/current/common-terms.html](http://www.elastic.co/guide/en/elasticsearch/guide/current/common-terms.html)  
mention that "One of the benefits of cutoff\_frequency is that you get  
domain-specific stopwords for free."

It seems like the index-per-user approach is required here in order to make  
the term frequencies accurate. If you used a shared index  
[http://www.elastic.co/guide/en/elasticsearch/guide/current/shared-index.html](http://www.elastic.co/guide/en/elasticsearch/guide/current/shared-index.html)  
or even faked an index per user  
[http://www.elastic.co/guide/en/elasticsearch/guide/current/faking-it.html](http://www.elastic.co/guide/en/elasticsearch/guide/current/faking-it.html),  
your TF counts for some field would reflect the index as a whole  
(aggregated across the counts for each shard in that index), not just for  
that user. If you tended to just query the documents for one user at a time  
using some filter field, the common terms query would probably not return  
the results you are expecting.

Am I understanding this correctly?

--  
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/398cfc81-ba3e-458c-840f-aee5e94902c4%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/398cfc81-ba3e-458c-840f-aee5e94902c4%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)\
**Post date:** [April 29, 2015, 9:54pm UTC](https://discuss.elastic.co/t/index-per-user-required-for-common-terms-query-and-cutoff-frequency/23476/2 "2015-04-29T21:54:46Z")

</div>

On Wed, Apr 29, 2015 at 2:53 PM, Loren [loren@siebert.org](mailto:loren@siebert.org) wrote:

> The docs  
> [http://www.elastic.co/guide/en/elasticsearch/guide/current/common-terms.html](http://www.elastic.co/guide/en/elasticsearch/guide/current/common-terms.html)  
> mention that "One of the benefits of cutoff\_frequency is that you get  
> domain-specific stopwords for free."
> 
> It seems like the index-per-user approach is required here in order to  
> make the term frequencies accurate. If you used a shared index  
> [http://www.elastic.co/guide/en/elasticsearch/guide/current/shared-index.html](http://www.elastic.co/guide/en/elasticsearch/guide/current/shared-index.html)  
> or even faked an index per user  
> [http://www.elastic.co/guide/en/elasticsearch/guide/current/faking-it.html](http://www.elastic.co/guide/en/elasticsearch/guide/current/faking-it.html),  
> your TF counts for some field would reflect the index as a whole  
> (aggregated across the counts for each shard in that index), not just for  
> that user. If you tended to just query the documents for one user at a time  
> using some filter field, the common terms query would probably not return  
> the results you are expecting.
> 
> Am I understanding this correctly?

I think you understand the issue perfectly, yes. cutoff\_frequency is per  
shard so each shard would need to contain only a single domain for the  
stopwords to really work.

Nik

--  
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/CAPmjWd1m7xk\_Hq36i%2BA7aRFsdinaAX1dJ%3DUa%2BL9qkB%3DjKwLDjg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1m7xk_Hq36i%2BA7aRFsdinaAX1dJ%3DUa%2BL9qkB%3DjKwLDjg%40mail.gmail.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:16am UTC](https://discuss.elastic.co/t/index-per-user-required-for-common-terms-query-and-cutoff-frequency/23476/3 "2017-07-06T00:16:54Z")

</div>


