[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.
This commit is contained in:
parent
1918a30237
commit
f7b5986682
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue