Browse Source

[Docs] Fix script-fields snippet execution (#30693)

Currently the first snippet in the documentation test in script-fields.asciidoc
isn't executed, although it has the CONSOLE annotation. Adding a test setup
annotation to it seems to fix the problem.
Christoph Büscher 7 years ago
parent
commit
f7b5986682
1 changed files with 3 additions and 3 deletions
  1. 3 3
      docs/reference/search/request/script-fields.asciidoc

+ 3 - 3
docs/reference/search/request/script-fields.asciidoc

@@ -15,13 +15,13 @@ GET /_search
         "test1" : {
             "script" : {
                 "lang": "painless",
-                "source": "doc['my_field_name'].value * 2"
+                "source": "doc['price'].value * 2"
             }
         },
         "test2" : {
             "script" : {
                 "lang": "painless",
-                "source": "doc['my_field_name'].value * params.factor",
+                "source": "doc['price'].value * params.factor",
                 "params" : {
                     "factor"  : 2.0
                 }
@@ -31,7 +31,7 @@ GET /_search
 }
 --------------------------------------------------
 // CONSOLE
-
+// TEST[setup:sales]
 
 Script fields can work on fields that are not stored (`my_field_name` in
 the above case), and allow to return custom values to be returned (the