"Fossies" - the Fresh Open Source Software Archive

Member "elasticsearch-6.8.23/docs/painless/painless-statements.asciidoc" (29 Dec 2021, 737 Bytes) of package /linux/www/elasticsearch-6.8.23-src.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format (assuming AsciiDoc format). Alternatively you can here view or download the uninterpreted source code file. A member file download can also be achieved by clicking within a package contents listing on the according byte size field.

Statements

Painless supports all of Java’s control flow statements except the switch statement.

Conditional statements

If / Else
if (doc[item].size() == 0) {
  // do something if "item" is missing
} else {
  // do something else
}

Loop statements

For

Painless also supports the for in syntax from Groovy:

for (def item : list) {
  ...
}