Skip to content

Commit 4692458

Browse files
REST test: Fixed expressions test
Perl reads the number as a string, so instead mapped the field as a long specifically. Also, the value returned in JSON is an integer, not a float
1 parent eec51df commit 4692458

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed
Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
2-
"Expressions scripting test":
3-
2+
setup:
3+
- do:
4+
indices.create:
5+
index: test123
6+
body:
7+
mappings:
8+
test:
9+
properties:
10+
age:
11+
type: long
412
- do:
513
index:
614
index: test123
@@ -11,5 +19,9 @@
1119
- do:
1220
indices.refresh: {}
1321

22+
---
23+
"Expressions scripting test":
24+
1425
- do: { search: { body: { script_fields : { my_field : { lang: expression, script: 'doc["age"].value' } } } } }
15-
- match: { hits.hits.0.fields.my_field: [ 23.0 ] }
26+
- match: { hits.hits.0.fields.my_field: [ 23 ] }
27+

0 commit comments

Comments
 (0)