Forráskód Böngészése

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
Clinton Gormley 10 éve
szülő
commit
53d0a0a4b9
1 módosított fájl, 15 hozzáadás és 3 törlés
  1. 15 3
      rest-api-spec/test/script/30_expressions.yaml

+ 15 - 3
rest-api-spec/test/script/30_expressions.yaml

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