Lookup [Scripted fields]

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

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 in Elasticsearch that allows you to look into other documents.