# Lookup \[Scripted fields\]

**URL:** <https://discuss.elastic.co/t/lookup-scripted-fields/210304>\
**Category:** Kibana\
**Created:** [December 3, 2019, 7:26am UTC](https://discuss.elastic.co/t/lookup-scripted-fields/210304 "2019-12-03T07:26:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![a.kuz](https://avatars.discourse-cdn.com/v4/letter/a/b5ac83/32.png) [@a.kuz](https://discuss.elastic.co/u/a.kuz)\
**Post date:** [December 3, 2019, 7:26am UTC](https://discuss.elastic.co/t/lookup-scripted-fields/210304/1 "2019-12-03T07:26:56Z")

</div>

Hello. How to do lookup fields from the same or another index in scripted fields?  
Thanks in advance.

---

<div class="post-metadata">

**Author:** ![flash1293](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/flash1293/32/41227_2.png) [@flash1293](https://discuss.elastic.co/u/flash1293)\
**Post date:** [December 6, 2019, 8:49am UTC](https://discuss.elastic.co/t/lookup-scripted-fields/210304/2 "2019-12-06T08:49:10Z")

</div>

Hi @a.kuz,

that's something which isn't possible with scripted fields - they only have access to the current document and nothing else.

However if you want to look up values from other indices (basically joining the indices in some way), you can do so during ingest time by using the [enrich processor](https://www.elastic.co/guide/en/elasticsearch/reference/current/enrich-processor.html) in Elasticsearch that allows you to look into other documents.

---

<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:** [January 3, 2020, 8:51am UTC](https://discuss.elastic.co/t/lookup-scripted-fields/210304/3 "2020-01-03T08:51:19Z")

</div>

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