# Operations over indexed documents

**URL:** <https://discuss.elastic.co/t/operations-over-indexed-documents/329068>\
**Category:** Elasticsearch\
**Created:** [March 31, 2023, 3:53pm UTC](https://discuss.elastic.co/t/operations-over-indexed-documents/329068 "2023-03-31T15:53:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [March 31, 2023, 3:53pm UTC](https://discuss.elastic.co/t/operations-over-indexed-documents/329068/1 "2023-03-31T15:53:56Z")

</div>

Hi,

Is it possible to compute variables taking the documents from an index as input? I will describe my current situation and my objective.

I have data indexed on an Elasticsearch cluster. My data contains a timestamp and a set of numeric values and identifiers. I'm currently running operations over my data using Python and the Eland library. I perform operations mainly selecting time windows and checking the existence of certain data to compute numeric values. As I run my script and compute my metrics I'm indexing this computed values on a new index on the cluster.

I want to know if it is possible to do something similar using Elasticsearch and/or Kibana. Is it possible to run a script over the data of my index and store the results in a new index. I think about it as a reindexing process, running the computation over the complete index to get the results and store them in a new index.

The ideal case would be to compute my metrics as I index the data in the index. However, I also don't know if it is possible.

Best regards,

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 1, 2023, 1:21am UTC](https://discuss.elastic.co/t/operations-over-indexed-documents/329068/2 "2023-04-01T01:21:09Z")

</div>

Hi @tmslara.a

Perhaps look at transforms... sound a lot like what you are trying to do.

> **[Transform overview | Elasticsearch Guide \[8.7\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/8.7/transform-overview.html)**

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [April 3, 2023, 3:39pm UTC](https://discuss.elastic.co/t/operations-over-indexed-documents/329068/3 "2023-04-03T15:39:39Z")

</div>

Thank you. I will read about it

---

<div class="post-metadata">

**Author:** ![tmslara.a](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tmslara.a/32/116339_2.png) [@tmslara.a](https://discuss.elastic.co/u/tmslara.a)\
**Post date:** [April 3, 2023, 4:02pm UTC](https://discuss.elastic.co/t/operations-over-indexed-documents/329068/4 "2023-04-03T16:02:24Z")

</div>

I checked transformations. I need to do more complex operations than aggregations. More like selecting data an run scripts.

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [April 3, 2023, 4:27pm UTC](https://discuss.elastic.co/t/operations-over-indexed-documents/329068/5 "2023-04-03T16:27:41Z")

</div>

> [@tmslara.a](#):
>
> I need to do more complex operations than aggregations. More like selecting data an run scripts.

Understood... Did you see that you can [run painless scripts as part of the transformation](https://www.elastic.co/guide/en/elasticsearch/reference/current/transform-painless-examples.html)... probably still not enough but just in case you missed it.

Many users use the data tool/language of their choice like python to do large-scale / complex processing.

---

<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, 2023, 4:28pm UTC](https://discuss.elastic.co/t/operations-over-indexed-documents/329068/6 "2023-05-01T16:28:36Z")

</div>

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