diff options
author | Jack Conradson <osjdconrad@gmail.com> | 2016-11-10 09:59:13 -0800 |
---|---|---|
committer | Jack Conradson <osjdconrad@gmail.com> | 2016-11-10 09:59:13 -0800 |
commit | aeb97ff41298e26b107a733837dfe17f123c0c9b (patch) | |
tree | 8d37fa8c7365df2ce52626b003c1838572a62d88 /core/src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java | |
parent | 2e531902ffb776e6ea9d15e99ab904aa4cb256dc (diff) |
Clean up of Script.
Closes #21321
Diffstat (limited to 'core/src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java')
-rw-r--r-- | core/src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/core/src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java b/core/src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java index 4c22a38f6f..17785d2cb3 100644 --- a/core/src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java +++ b/core/src/test/java/org/elasticsearch/search/aggregations/metrics/CardinalityIT.java @@ -306,7 +306,7 @@ public class CardinalityIT extends ESIntegTestCase { .addAggregation( cardinality("cardinality") .precisionThreshold(precisionThreshold) - .script(new Script("doc['str_value'].value", ScriptType.INLINE, CustomScriptPlugin.NAME, emptyMap()))) + .script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "doc['str_value'].value", emptyMap()))) .execute().actionGet(); assertSearchResponse(response); @@ -322,7 +322,7 @@ public class CardinalityIT extends ESIntegTestCase { .addAggregation( cardinality("cardinality") .precisionThreshold(precisionThreshold) - .script(new Script("doc['str_values'].values", ScriptType.INLINE, CustomScriptPlugin.NAME, emptyMap()))) + .script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "doc['str_values'].values", emptyMap()))) .execute().actionGet(); assertSearchResponse(response); @@ -334,7 +334,7 @@ public class CardinalityIT extends ESIntegTestCase { } public void testSingleValuedNumericScript() throws Exception { - Script script = new Script("doc[' + singleNumericField() + '].value", ScriptType.INLINE, CustomScriptPlugin.NAME, emptyMap()); + Script script = new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "doc[' + singleNumericField() + '].value", emptyMap()); SearchResponse response = client().prepareSearch("idx").setTypes("type") .addAggregation(cardinality("cardinality").precisionThreshold(precisionThreshold).script(script)) .execute().actionGet(); @@ -348,7 +348,8 @@ public class CardinalityIT extends ESIntegTestCase { } public void testMultiValuedNumericScript() throws Exception { - Script script = new Script("doc[' + multiNumericField(false) + '].values", ScriptType.INLINE, CustomScriptPlugin.NAME, null); + Script script = + new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "doc[' + multiNumericField(false) + '].values", Collections.emptyMap()); SearchResponse response = client().prepareSearch("idx").setTypes("type") .addAggregation(cardinality("cardinality").precisionThreshold(precisionThreshold).script(script)) .execute().actionGet(); @@ -367,7 +368,7 @@ public class CardinalityIT extends ESIntegTestCase { cardinality("cardinality") .precisionThreshold(precisionThreshold) .field("str_value") - .script(new Script("_value", ScriptType.INLINE, CustomScriptPlugin.NAME, emptyMap()))) + .script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_value", emptyMap()))) .execute().actionGet(); assertSearchResponse(response); @@ -384,7 +385,7 @@ public class CardinalityIT extends ESIntegTestCase { cardinality("cardinality") .precisionThreshold(precisionThreshold) .field("str_values") - .script(new Script("_value", ScriptType.INLINE, CustomScriptPlugin.NAME, emptyMap()))) + .script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_value", emptyMap()))) .execute().actionGet(); assertSearchResponse(response); @@ -401,7 +402,7 @@ public class CardinalityIT extends ESIntegTestCase { cardinality("cardinality") .precisionThreshold(precisionThreshold) .field(singleNumericField()) - .script(new Script("_value", ScriptType.INLINE, CustomScriptPlugin.NAME, emptyMap()))) + .script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_value", emptyMap()))) .execute().actionGet(); assertSearchResponse(response); @@ -418,7 +419,7 @@ public class CardinalityIT extends ESIntegTestCase { cardinality("cardinality") .precisionThreshold(precisionThreshold) .field(multiNumericField(false)) - .script(new Script("_value", ScriptType.INLINE, CustomScriptPlugin.NAME, emptyMap()))) + .script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_value", emptyMap()))) .execute().actionGet(); assertSearchResponse(response); @@ -467,7 +468,7 @@ public class CardinalityIT extends ESIntegTestCase { // Test that a request using a script does not get cached SearchResponse r = client().prepareSearch("cache_test_idx").setSize(0) .addAggregation( - cardinality("foo").field("d").script(new Script("_value", ScriptType.INLINE, CustomScriptPlugin.NAME, emptyMap()))) + cardinality("foo").field("d").script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_value", emptyMap()))) .get(); assertSearchResponse(r); |