--- setup: - do: indices.create: index: test123 body: mappings: test: properties: age: type: long - do: index: index: test123 type: test id: 1 body: { age: 23 } - do: indices.refresh: {} --- "Expressions scripting test": - do: { search: { body: { script_fields : { my_field : { lang: expression, script: 'doc["age"].value + 19' } } } } } - match: { hits.hits.0.fields.my_field.0: 42.0 }