Skip to content

Commit

Permalink
[Docs] Fix script-fields snippet execution (#30693)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Christoph Büscher committed May 22, 2018
1 parent 31fc805 commit e1d1eb7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/reference/search/request/script-fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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
Expand Down

0 comments on commit e1d1eb7

Please sign in to comment.