# Generate murmur3 (hyperloglog) hash outside of ES

**URL:** <https://discuss.elastic.co/t/generate-murmur3-hyperloglog-hash-outside-of-es/29490>\
**Category:** Elasticsearch\
**Created:** [September 17, 2015, 3:30pm UTC](https://discuss.elastic.co/t/generate-murmur3-hyperloglog-hash-outside-of-es/29490 "2015-09-17T15:30:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jaikit](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jaikit](https://discuss.elastic.co/u/jaikit)\
**Post date:** [September 17, 2015, 3:30pm UTC](https://discuss.elastic.co/t/generate-murmur3-hyperloglog-hash-outside-of-es/29490/1 "2015-09-17T15:30:17Z")

</div>

Hello,

Is there any way to provide murmur3 hash as part of document while indexing ? Here is my usecase and only reason I want to generate outside of ES is because of scale. Appreciate any hints.

I have..  
**user1 document1**  
**user2 document2**  
**user3 document1**  
**user4 document1**  
**user5 document1**  
**user6 document1**  
**......**  
**......**  
**......**  
**4 Billion events**

Group By document  
**document1: {user1, user3, user4, user5, user6, ...} (up to 100M users)**  
**document2: {user2, ...}**

For Each document generate  
**document1: murmur3 hash**  
**document2: murmur3 hash**

Index document1, document2

Now query which matches document1 and document2 and cardinality should return approximate distinct users based on murmur hash generated.

Thanks,  
Jaikit

---

<div class="post-metadata">

**Author:** ![jaikit](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jaikit](https://discuss.elastic.co/u/jaikit)\
**Post date:** [September 22, 2015, 6:45am UTC](https://discuss.elastic.co/t/generate-murmur3-hyperloglog-hash-outside-of-es/29490/2 "2015-09-22T06:45:23Z")

</div>

@Adrien_Grand Could you please provide any tips on how I can generate murmur hash outside of ElasticSearch and later use that to find cardinality ?

Thanks in Advance.

---

<div class="post-metadata">

**Author:** ![jaikit](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jaikit](https://discuss.elastic.co/u/jaikit)\
**Post date:** [September 22, 2015, 6:58am UTC](https://discuss.elastic.co/t/generate-murmur3-hyperloglog-hash-outside-of-es/29490/3 "2015-09-22T06:58:51Z")

</div>

Reading more I found documentation on "Precomputed hashes" on client side but it does not mention how. Would really appreciate If anyone can point any reference or code sample on how to compute hash.

[https://www.elastic.co/guide/en/elasticsearch/reference/2.0/search-aggregations-metrics-cardinality-aggregation.html#\_pre\_computed\_hashes](https://www.elastic.co/guide/en/elasticsearch/reference/2.0/search-aggregations-metrics-cardinality-aggregation.html#_pre_computed_hashes)

---

<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 5, 2017, 11:48pm UTC](https://discuss.elastic.co/t/generate-murmur3-hyperloglog-hash-outside-of-es/29490/4 "2017-07-05T23:48:51Z")

</div>


