# Elastic Search Indexing

**URL:** <https://discuss.elastic.co/t/elastic-search-indexing/238212>\
**Category:** Elasticsearch\
**Created:** [June 23, 2020, 8:42am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212 "2020-06-23T08:42:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vijaya](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@vijaya](https://discuss.elastic.co/u/vijaya)\
**Post date:** [June 23, 2020, 8:42am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/1 "2020-06-23T08:42:44Z")

</div>

Dear Team,

How to include aggregations at the time of creating indexing in elastic search.

Please help me.

Best Regards,  
Vijaya.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 23, 2020, 8:43am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/2 "2020-06-23T08:43:50Z")

</div>

Welcome to our community! 😃

Do you mean you want to store the aggregations instead of the data?

---

<div class="post-metadata">

**Author:** ![vijaya](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@vijaya](https://discuss.elastic.co/u/vijaya)\
**Post date:** [June 23, 2020, 8:44am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/3 "2020-06-23T08:44:59Z")

</div>

> [@warkolm](#):
>
> u want to store the aggregations instead of the data?

Yes Warkolm

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 23, 2020, 8:46am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/4 "2020-06-23T08:46:11Z")

</div>

The data needs to live in Elasticsearch for an aggregation to be run against it.

Look at using the `_rollup` endpoint and then storing that into another index once you have the data indexed.

---

<div class="post-metadata">

**Author:** ![vijaya](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@vijaya](https://discuss.elastic.co/u/vijaya)\
**Post date:** [June 23, 2020, 8:50am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/5 "2020-06-23T08:50:52Z")

</div>

Ok thank you so much.

---

<div class="post-metadata">

**Author:** ![vijaya](https://avatars.discourse-cdn.com/v4/letter/v/e47774/32.png) [@vijaya](https://discuss.elastic.co/u/vijaya)\
**Post date:** [June 24, 2020, 7:02am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/6 "2020-06-24T07:02:25Z")

</div>

Initially i will create the indexing then i can apply the aggregations (By using of GET method i can get the aggregations like min,max,avg..etc) on that index.  
But here my goal is how to include data(indexed data) and aggregations (like min,max..etc ) in index at the time of index creation in PUT method.

Best Regards,  
Vijaya

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [June 24, 2020, 7:05am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/7 "2020-06-24T07:05:43Z")

</div>

You cannot run an aggregation on an index that has no data in it though, it's not how they work.

---

<div class="post-metadata">

**Author:** ![mykael](https://avatars.discourse-cdn.com/v4/letter/m/ec9cab/32.png) [@mykael](https://discuss.elastic.co/u/mykael)\
**Post date:** [June 24, 2020, 7:25am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/8 "2020-06-24T07:25:33Z")

</div>

Store your data in a short lived index and use a continuous transform to stash the aggregated data into another index that you keep longer term.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 24, 2020, 7:51am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/9 "2020-06-24T07:51:06Z")

</div>

Do you know that Elasticsearch is fast enough to compute that at search time?  
Why is the reason you want to do this at index time?

---

<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 22, 2020, 7:51am UTC](https://discuss.elastic.co/t/elastic-search-indexing/238212/10 "2020-07-22T07:51:13Z")

</div>

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