How do we write painless script for scripted fields

Hi Team,

am trying to write painless script for the below scenario..

i have department numbers like 1100,1200,1300... so, instead of department numbers am expecting short name as IND, USA, UK....by using scripted field.
Please let me know the painless script field for the same.

Thanks in advance.

Hi @Abj_Ins,

Where are the short names coming from? Do they map to a particular set of department numbers?

The reason I as is although you could write a painless script, another option could be to use an ingest pipeline and enrichment processor as an alternative depending on what you need to do.

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