# Use BloomFilter as default codec for uid field

**URL:** <https://discuss.elastic.co/t/use-bloomfilter-as-default-codec-for-uid-field/145267>\
**Category:** Elasticsearch\
**Created:** [August 21, 2018, 1:55am UTC](https://discuss.elastic.co/t/use-bloomfilter-as-default-codec-for-uid-field/145267 "2018-08-21T01:55:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![yiguolei](https://avatars.discourse-cdn.com/v4/letter/y/54ee81/32.png) [@yiguolei](https://discuss.elastic.co/u/yiguolei)\
**Post date:** [August 21, 2018, 1:55am UTC](https://discuss.elastic.co/t/use-bloomfilter-as-default-codec-for-uid-field/145267/1 "2018-08-21T01:55:49Z")

</div>

lucene has bloomfilter codec for low frequency field (like primary keys), why not use bloom filter codec as default codec for uid field in elasticsearch?

[https://issues.apache.org/jira/browse/LUCENE-4069](https://issues.apache.org/jira/browse/LUCENE-4069)

---

<div class="post-metadata">

**Author:** ![polyfractal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/polyfractal/32/48162_2.png) [@polyfractal](https://discuss.elastic.co/u/polyfractal)\
**Post date:** [August 24, 2018, 1:30pm UTC](https://discuss.elastic.co/t/use-bloomfilter-as-default-codec-for-uid-field/145267/2 "2018-08-24T13:30:41Z")

</div>

In the past, we used bloom filters on the UID field. But improvements in Lucene and how we use Lucene's `TermsEnum` made the usage of blooms obsolete. We were able to remove the bloom filters, keep the same query performance and reduce memory usage by not requiring the extra bloom data structure.

You can read some of the history here:

> <https://github.com/elastic/elasticsearch/pull/6298>

  

> <https://github.com/elastic/elasticsearch/issues/6349>

---

<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:** [September 21, 2018, 1:30pm UTC](https://discuss.elastic.co/t/use-bloomfilter-as-default-codec-for-uid-field/145267/3 "2018-09-21T13:30:46Z")

</div>

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