# Save elasticsearch results

**URL:** <https://discuss.elastic.co/t/save-elasticsearch-results/101836>\
**Category:** Elasticsearch\
**Created:** [September 26, 2017, 11:13am UTC](https://discuss.elastic.co/t/save-elasticsearch-results/101836 "2017-09-26T11:13:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![afonso.ribeiro](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@afonso.ribeiro](https://discuss.elastic.co/u/afonso.ribeiro)\
**Post date:** [September 26, 2017, 11:13am UTC](https://discuss.elastic.co/t/save-elasticsearch-results/101836/1 "2017-09-26T11:13:24Z")

</div>

Hi everyone,

I'm taking the first steps in elasticsearch and I have a question.

I have an index with the sales of my company and the respective sales days.

I need to add up all the sales per month and make a chart to see the evolution over time.

Is it possible to save the results of sales per month in a different index so that I can make the chart?

Should I do it in other way?

Thanks you in advance

---

<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:** [September 26, 2017, 11:25am UTC](https://discuss.elastic.co/t/save-elasticsearch-results/101836/2 "2017-09-26T11:25:58Z")

</div>

Why not just querying elasticsearch? It has the data.

Just run a date\_histogram aggregation and you're done.

---

<div class="post-metadata">

**Author:** ![aboullaite](https://avatars.discourse-cdn.com/v4/letter/a/f19dbf/32.png) [@aboullaite](https://discuss.elastic.co/u/aboullaite)\
**Post date:** [September 26, 2017, 11:29am UTC](https://discuss.elastic.co/t/save-elasticsearch-results/101836/3 "2017-09-26T11:29:44Z")

</div>

I think that you can use the Reindex action in curator to acheive this: [https://www.elastic.co/guide/en/elasticsearch/client/curator/current/reindex.html](https://www.elastic.co/guide/en/elasticsearch/client/curator/current/reindex.html)

---

<div class="post-metadata">

**Author:** ![afonso.ribeiro](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@afonso.ribeiro](https://discuss.elastic.co/u/afonso.ribeiro)\
**Post date:** [September 26, 2017, 11:53am UTC](https://discuss.elastic.co/t/save-elasticsearch-results/101836/4 "2017-09-26T11:53:12Z")

</div>

Yes, that is a possibility. The thing is, if I want the accumulated sales through the time. In this case, is it still possible with the histogram? Thanks for the answer

---

<div class="post-metadata">

**Author:** ![afonso.ribeiro](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@afonso.ribeiro](https://discuss.elastic.co/u/afonso.ribeiro)\
**Post date:** [September 26, 2017, 11:54am UTC](https://discuss.elastic.co/t/save-elasticsearch-results/101836/5 "2017-09-26T11:54:30Z")

</div>

I will see that. Thanks very much

---

<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:** [September 26, 2017, 12:04pm UTC](https://discuss.elastic.co/t/save-elasticsearch-results/101836/6 "2017-09-26T12:04:10Z")

</div>

So? A sum? There is a sum aggregation indeed.

---

<div class="post-metadata">

**Author:** ![afonso.ribeiro](https://avatars.discourse-cdn.com/v4/letter/a/a88e57/32.png) [@afonso.ribeiro](https://discuss.elastic.co/u/afonso.ribeiro)\
**Post date:** [September 26, 2017, 4:03pm UTC](https://discuss.elastic.co/t/save-elasticsearch-results/101836/7 "2017-09-26T16:03:54Z")

</div>

Exacly what I needed. Thanks very much

---

<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:** [October 24, 2017, 4:04pm UTC](https://discuss.elastic.co/t/save-elasticsearch-results/101836/8 "2017-10-24T16:04:08Z")

</div>

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