# Using "hash" subfield for import-time pre-aggregated records?

**URL:** <https://discuss.elastic.co/t/using-hash-subfield-for-import-time-pre-aggregated-records/81051>\
**Category:** Elasticsearch\
**Created:** [April 3, 2017, 8:57pm UTC](https://discuss.elastic.co/t/using-hash-subfield-for-import-time-pre-aggregated-records/81051 "2017-04-03T20:57:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ei-grad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ei-grad/32/5775_2.png) [@ei-grad](https://discuss.elastic.co/u/ei-grad)\
**Post date:** [April 3, 2017, 8:57pm UTC](https://discuss.elastic.co/t/using-hash-subfield-for-import-time-pre-aggregated-records/81051/1 "2017-04-03T20:57:16Z")

</div>

Since there exists an ability to [precalculate hash values for hyperloglog](https://www.elastic.co/guide/en/elasticsearch/plugins/5.3/mapper-murmur3-usage.html), it looks straight to use it for the cardinality calculation on import time pre-aggregated records, i.e someone calculates a murmur3 hash value over a high-cardinality field for some records with a common dimensions and puts the result into the single ES doc containing the calculated hash value in the hash subfield of this field (with the plain cardinality as value of field itself), and then one could use it in cardinality aggregation on this field.

Could it be used this way already or is there something against? Am I miss something?

Other interesting thing to discuss should be the ingest mode functionality for such pre-aggregation.

---

<div class="post-metadata">

**Author:** ![ei-grad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ei-grad/32/5775_2.png) [@ei-grad](https://discuss.elastic.co/u/ei-grad)\
**Post date:** [April 3, 2017, 10:16pm UTC](https://discuss.elastic.co/t/using-hash-subfield-for-import-time-pre-aggregated-records/81051/2 "2017-04-03T22:16:57Z")

</div>

Oh. It looks from source code, that this hash doesn't relate to hyperloglog. It is used just as a short alternative for a long text values, sad :-(.

---

<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:** [May 1, 2017, 10:17pm UTC](https://discuss.elastic.co/t/using-hash-subfield-for-import-time-pre-aggregated-records/81051/3 "2017-05-01T22:17:01Z")

</div>

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