|
@@ -18,7 +18,7 @@ The standard <<painless-api-reference-shared, Painless API>> is available.
|
|
|
|
|
|
*Example*
|
|
|
|
|
|
-[source,Painless]
|
|
|
+[source,js]
|
|
|
----
|
|
|
POST _watcher/watch/_execute
|
|
|
{
|
|
@@ -65,6 +65,8 @@ POST _watcher/watch/_execute
|
|
|
}
|
|
|
}
|
|
|
----
|
|
|
+// CONSOLE
|
|
|
+// TEST[skip: requires setup from other pages]
|
|
|
|
|
|
<1> The Java Stream API is used in the condition. This API allows manipulation of
|
|
|
the elements of the list in a pipeline.
|
|
@@ -76,7 +78,7 @@ on the value of the seats sold for the plays in the data set. The script aggrega
|
|
|
the total sold seats for each play and returns true if there is at least one play
|
|
|
that has sold over $50,000.
|
|
|
|
|
|
-[source,Painless]
|
|
|
+[source,js]
|
|
|
----
|
|
|
POST _watcher/watch/_execute
|
|
|
{
|
|
@@ -121,6 +123,8 @@ POST _watcher/watch/_execute
|
|
|
}
|
|
|
}
|
|
|
----
|
|
|
+// CONSOLE
|
|
|
+// TEST[skip: requires setup from other pages]
|
|
|
|
|
|
This example uses a nearly identical condition as the previous example. The
|
|
|
differences below are subtle and are worth calling out.
|