# Should filters be used for fields with high cardinality?

**URL:** https://discuss.elastic.co/t/should-filters-be-used-for-fields-with-high-cardinality/382773
**Category:** Elasticsearch
**Created:** [October 16, 2025, 11:14am UTC](https://discuss.elastic.co/t/should-filters-be-used-for-fields-with-high-cardinality/382773 "2025-10-16T11:14:30Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![yeikel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yeikel/32/125434_2.png) [@yeikel](https://discuss.elastic.co/u/yeikel)
#### Post date: [October 16, 2025, 11:14am UTC](https://discuss.elastic.co/t/should-filters-be-used-for-fields-with-high-cardinality/382773/1 "2025-10-16T11:14:30Z")

</div>

Hi all,

Should Elasticsearch query filters be applied to fields with high cardinality?

From what I understand, filters are not scored, and they are cached.

However, I’m wondering if it’s better to cache only filters on low-cardinality fields. Would caching filters for high-cardinality fields cause unnecessary memory usage or potentially reduce performance/limit the benefit?

---

<div class="post-metadata">

### Author: ![Mark\_Harwood1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood1/32/101255_2.png) [@Mark\_Harwood1](https://discuss.elastic.co/u/Mark_Harwood1)
#### Post date: [October 20, 2025, 8:34pm UTC](https://discuss.elastic.co/t/should-filters-be-used-for-fields-with-high-cardinality/382773/3 "2025-10-20T20:34:44Z")

</div>

It depends ™️

If your field is something like an ID peculiar to a user (eg a security filter added to narrow documents to a user’s content) then use the “preference” routing option to ensure users requests go back to the same replica with a hopefully warm cache.

Many high cardinality fields will have a Zipf-like distribution (very many low frequency terms but a few highly popular terms). The high popularity terms will benefit from being cached.

However, this is speculation and only testing will give you the true answer for your particular environment.
