Scripted field with stored script

Ilia - It depends :slight_smile: I think of scripted fields as a way to experiment with data, not something permanent you want to use at a large scale.

Each scripted field you create will automatically show up in Discover for that index pattern and slow down each loading of that page for every user (not to mention create an additional processing load in Elasticsearch). If scripted fields are sufficiently computationally complex (e.g. string parsing, regex), that kind of behavior could be undesirable. In general, I'd recommend creating scripted fields in dev/test, load testing them and only then promoting them to production. Also, once you know the field does what you want, you should index it directly in Elasticsearch, to avoid the cost of ad-hoc computation.

1 Like