Skip to content

Commit f7b5986

Browse files
author
Christoph Büscher
authored
[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.
1 parent 1918a30 commit f7b5986

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ GET /_search
1515
"test1" : {
1616
"script" : {
1717
"lang": "painless",
18-
"source": "doc['my_field_name'].value * 2"
18+
"source": "doc['price'].value * 2"
1919
}
2020
},
2121
"test2" : {
2222
"script" : {
2323
"lang": "painless",
24-
"source": "doc['my_field_name'].value * params.factor",
24+
"source": "doc['price'].value * params.factor",
2525
"params" : {
2626
"factor" : 2.0
2727
}
@@ -31,7 +31,7 @@ GET /_search
3131
}
3232
--------------------------------------------------
3333
// CONSOLE
34-
34+
// TEST[setup:sales]
3535

3636
Script fields can work on fields that are not stored (`my_field_name` in
3737
the above case), and allow to return custom values to be returned (the

0 commit comments

Comments
 (0)