2015-02-18 13:25:09 -05:00
|
|
|
---
|
2015-02-28 11:02:07 -05:00
|
|
|
setup:
|
|
|
|
- do:
|
|
|
|
indices.create:
|
|
|
|
index: test123
|
|
|
|
body:
|
|
|
|
mappings:
|
|
|
|
test:
|
|
|
|
properties:
|
|
|
|
age:
|
|
|
|
type: long
|
2015-02-18 13:25:09 -05:00
|
|
|
- do:
|
|
|
|
index:
|
|
|
|
index: test123
|
|
|
|
type: test
|
|
|
|
id: 1
|
|
|
|
body: { age: 23 }
|
|
|
|
|
|
|
|
- do:
|
|
|
|
indices.refresh: {}
|
|
|
|
|
2015-02-28 11:02:07 -05:00
|
|
|
---
|
|
|
|
"Expressions scripting test":
|
|
|
|
|
2015-03-02 08:58:36 -05:00
|
|
|
- do: { search: { body: { script_fields : { my_field : { lang: expression, script: 'doc["age"].value + 19' } } } } }
|
|
|
|
- match: { hits.hits.0.fields.my_field.0: 42.0 }
|
2015-02-28 11:02:07 -05:00
|
|
|
|