From 3b5f42127351443b2732ea3e1ad06701db0b3797 Mon Sep 17 00:00:00 2001 From: Mayya Sharipova Date: Fri, 18 May 2018 12:39:21 -0400 Subject: [PATCH] Set system property for tests and update painless-getting-started --- .../painless-getting-started.asciidoc | 19 ++++++++++--------- modules/parent-join/build.gradle | 3 +++ modules/percolator/build.gradle | 4 ++++ server/build.gradle | 4 ++++ x-pack/plugin/security/build.gradle | 1 + 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/painless/painless-getting-started.asciidoc b/docs/painless/painless-getting-started.asciidoc index 1812a129ab243..47f8bf03c5f0a 100644 --- a/docs/painless/painless-getting-started.asciidoc +++ b/docs/painless/painless-getting-started.asciidoc @@ -140,15 +140,6 @@ set a <> `-Des.script.null_for_missing_value=true` on a node. If you do not enable this behavior, a deprecation warning is logged on start up. -===== Multiple values - -Painless supports the following operations for multi-value numeric fields: - -- `doc['field'].min` - gets the minimum value -- `doc['field'].max` - gets the maximum value -- `doc['field'].sum` - gets the sum of the values -- `doc['field'].avg` - gets the average of the values - [float] ==== Updating Fields with Painless @@ -388,6 +379,16 @@ Note: all of the `_update_by_query` examples above could really do with a as using any other query because script queries aren't able to use the inverted index to limit the documents that they have to check. +[[multi-value-field-operations]] +=== Multi-value field operations + +Painless supports the following operations for multi-value numeric fields: + +- `doc['field'].min` - gets the minimum value +- `doc['field'].max` - gets the maximum value +- `doc['field'].sum` - gets the sum of the values +- `doc['field'].avg` - gets the average of the values + [[modules-scripting-painless-dispatch]] === How painless dispatches functions diff --git a/modules/parent-join/build.gradle b/modules/parent-join/build.gradle index 67bcc9d54e8e7..38563e467914b 100644 --- a/modules/parent-join/build.gradle +++ b/modules/parent-join/build.gradle @@ -22,3 +22,6 @@ esplugin { classname 'org.elasticsearch.join.ParentJoinPlugin' hasClientJar = true } +test.configure { + systemProperty 'es.script.null_for_missing_value', 'true' +} diff --git a/modules/percolator/build.gradle b/modules/percolator/build.gradle index db4a716af6513..7be888d377dd3 100644 --- a/modules/percolator/build.gradle +++ b/modules/percolator/build.gradle @@ -36,3 +36,7 @@ dependencyLicenses { compileJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes" compileTestJava.options.compilerArgs << "-Xlint:-deprecation,-rawtypes" + +test.configure { + systemProperty 'es.script.null_for_missing_value', 'true' +} diff --git a/server/build.gradle b/server/build.gradle index 7e880e0dae4d2..2c3ae6e6573e3 100644 --- a/server/build.gradle +++ b/server/build.gradle @@ -338,3 +338,7 @@ if (isEclipse == false || project.path == ":server-tests") { check.dependsOn integTest integTest.mustRunAfter test } + +test.configure { + systemProperty 'es.script.null_for_missing_value', 'true' +} diff --git a/x-pack/plugin/security/build.gradle b/x-pack/plugin/security/build.gradle index 12533a389b5f1..e4b24343c4a37 100644 --- a/x-pack/plugin/security/build.gradle +++ b/x-pack/plugin/security/build.gradle @@ -225,6 +225,7 @@ test { * other if we allow them to set the number of available processors as it's set-once in Netty. */ systemProperty 'es.set.netty.runtime.available.processors', 'false' + systemProperty 'es.script.null_for_missing_value', 'true' } // xpack modules are installed in real clusters as the meta plugin, so