File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 44Painless supports all of Java's https://docs.oracle.com/javase/tutorial/java/nutsandbolts/flow.html[
55control flow statements] except the `switch` statement.
66
7+ ==== Conditional statements
8+
9+ ===== If / Else
10+
11+ [source,painless]
12+ ---------------------------------------------------------
13+ if (doc[item].size() == 0) {
14+ // do something if "item" is missing
15+ } else {
16+ // do something else
17+ }
18+ ---------------------------------------------------------
19+
20+ ==== Loop statements
21+
22+ ===== For
23+
724Painless also supports the `for in` syntax from Groovy:
825
926[source,painless]
1027---------------------------------------------------------
1128for (item : list) {
1229 ...
1330}
14- ---------------------------------------------------------
31+ ---------------------------------------------------------
You can’t perform that action at this time.
0 commit comments