diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests-trigger.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests-trigger.yml
deleted file mode 100644
index d8c8b557e4514..0000000000000
--- a/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests-trigger.yml
+++ /dev/null
@@ -1,6 +0,0 @@
----
-jjbb-template: periodic-trigger-lgc.yml
-vars:
- - periodic-job: elastic+elasticsearch+%BRANCH%+periodic+packaging-tests
- - lgc-job: elastic+elasticsearch+%BRANCH%+intake
- - cron: "H H/8 * * *"
diff --git a/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests.yml b/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests.yml
index a68641f50a174..e6f6cb5c3771b 100644
--- a/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests.yml
+++ b/.ci/jobs.t/elastic+elasticsearch+periodic+packaging-tests.yml
@@ -2,7 +2,8 @@
- job:
name: elastic+elasticsearch+%BRANCH%+periodic+packaging-tests
display-name: "elastic / elasticsearch # %BRANCH% - packaging tests"
- description: "Testing of the Elasticsearch %BRANCH% branch packaging tests.\n"
+ description: "This job has been migrated to Buildkite.\n"
+ disabled: true
project-type: multijob
node: master
vault: []
diff --git a/docs/changelog/101120.yaml b/docs/changelog/101120.yaml
new file mode 100644
index 0000000000000..bf359eb21be9f
--- /dev/null
+++ b/docs/changelog/101120.yaml
@@ -0,0 +1,6 @@
+pr: 101120
+summary: "ESQL: Fix escaping of backslash in LIKE operator"
+area: ES|QL
+type: bug
+issues:
+ - 101106
diff --git a/docs/reference/esql/esql-enrich-data.asciidoc b/docs/reference/esql/esql-enrich-data.asciidoc
new file mode 100644
index 0000000000000..d7a2c81df9ece
--- /dev/null
+++ b/docs/reference/esql/esql-enrich-data.asciidoc
@@ -0,0 +1,126 @@
+[[esql-enrich-data]]
+=== Enrich data
+
+++++
+Enrich data
+++++
+
+You can use {esql}'s <> processing command to enrich a table with
+data from indices in {es}.
+
+For example, you can use `ENRICH` to:
+
+* Identify web services or vendors based on known IP addresses
+* Add product information to retail orders based on product IDs
+* Supplement contact information based on an email address
+
+[[esql-how-enrich-works]]
+==== How the `ENRICH` command works
+
+The `ENRICH` command adds new columns to a table, with data from {es} indices.
+It requires a few special components:
+
+image::images/esql/esql-enrich.png[align="center"]
+
+[[esql-enrich-policy]]
+Enrich policy::
++
+--
+A set of configuration options used to add the right enrich data to the input
+table.
+
+An enrich policy contains:
+
+include::../ingest/enrich.asciidoc[tag=enrich-policy-fields]
+
+After <>, it must be
+<> before it can be used. Executing an
+enrich policy uses data from the policy's source indices to create a streamlined
+system index called the _enrich index_. The `ENRICH` command uses this index to
+match and enrich an input table.
+--
+
+[[esql-source-index]]
+Source index::
+An index which stores enrich data that the `ENRICH` command can add to input
+tables. You can create and manage these indices just like a regular {es} index.
+You can use multiple source indices in an enrich policy. You also can use the
+same source index in multiple enrich policies.
+
+[[esql-enrich-index]]
+Enrich index::
++
+--
+A special system index tied to a specific enrich policy.
+
+Directly matching rows from input tables to documents in source indices could be
+slow and resource intensive. To speed things up, the `ENRICH` command uses an
+enrich index.
+
+include::../ingest/enrich.asciidoc[tag=enrich-index]
+--
+
+[[esql-set-up-enrich-policy]]
+==== Set up an enrich policy
+
+To start using `ENRICH`, follow these steps:
+
+. Check the <>.
+. <>.
+. <>.
+. <>.
+. <>
+
+Once you have enrich policies set up, you can <> and <>.
+
+[IMPORTANT]
+====
+The `ENRICH` command performs several operations and may impact the speed of
+your query.
+====
+
+[[esql-enrich-prereqs]]
+===== Prerequisites
+
+include::{es-repo-dir}/ingest/apis/enrich/put-enrich-policy.asciidoc[tag=enrich-policy-api-prereqs]
+
+[[esql-create-enrich-source-index]]
+===== Add enrich data
+
+include::../ingest/enrich.asciidoc[tag=create-enrich-source-index]
+
+[[esql-create-enrich-policy]]
+===== Create an enrich policy
+
+include::../ingest/enrich.asciidoc[tag=create-enrich-policy]
+
+[[esql-execute-enrich-policy]]
+===== Execute the enrich policy
+
+include::../ingest/enrich.asciidoc[tag=execute-enrich-policy1]
+
+image::images/esql/esql-enrich-policy.png[align="center"]
+
+include::../ingest/enrich.asciidoc[tag=execute-enrich-policy2]
+
+[[esql-use-enrich]]
+==== Use the enrich policy
+
+After the policy has been executed, you can use the <> to enrich your data.
+
+image::images/esql/esql-enrich-command.png[align="center",width=50%]
+
+include::processing-commands/enrich.asciidoc[tag=examples]
+
+[[esql-update-enrich-data]]
+==== Update an enrich index
+
+include::{es-repo-dir}/ingest/apis/enrich/execute-enrich-policy.asciidoc[tag=update-enrich-index]
+
+[[esql-update-enrich-policies]]
+==== Update an enrich policy
+
+include::../ingest/enrich.asciidoc[tag=update-enrich-policy]
diff --git a/docs/reference/esql/esql-language.asciidoc b/docs/reference/esql/esql-language.asciidoc
index 10af5a6e9702c..399034737efaa 100644
--- a/docs/reference/esql/esql-language.asciidoc
+++ b/docs/reference/esql/esql-language.asciidoc
@@ -10,7 +10,9 @@ Detailed information about the {esql} language:
* <>
* <>
* <>
+* <>
include::esql-syntax.asciidoc[]
include::multivalued-fields.asciidoc[]
-include::metadata-fields.asciidoc[]
\ No newline at end of file
+include::metadata-fields.asciidoc[]
+include::esql-enrich-data.asciidoc[]
\ No newline at end of file
diff --git a/docs/reference/esql/processing-commands/enrich.asciidoc b/docs/reference/esql/processing-commands/enrich.asciidoc
index 1aaa95367ff92..1e489119d4ca3 100644
--- a/docs/reference/esql/processing-commands/enrich.asciidoc
+++ b/docs/reference/esql/processing-commands/enrich.asciidoc
@@ -1,8 +1,55 @@
[discrete]
[[esql-enrich]]
=== `ENRICH`
-You can use `ENRICH` to add data from your existing indices to incoming records.
-It's similar to <>, but it works at query time.
+
+**Syntax**
+
+[source,txt]
+----
+ENRICH policy [ON match_field] [WITH [new_name1 = ]field1, [new_name2 = ]field2, ...]
+----
+
+*Parameters*
+
+`policy`::
+The name of the enrich policy. You need to <>
+and <> the enrich policy first.
+
+`ON match_field`::
+The match field. `ENRICH` uses its value to look for records in the enrich
+index. If not specified, the match will be performed on the column with the same
+name as the `match_field` defined in the <>.
+
+`WITH fieldX`::
+The enrich fields from the enrich index that are added to the result as new
+columns. If a column with the same name as the enrich field already exists, the
+existing column will be replaced by the new column. If not specified, each of
+the enrich fields defined in the policy is added
+
+`new_nameX =`::
+Enables you to change the name of the column that's added for each of the enrich
+fields. Defaults to the enrich field name.
+
+*Description*
+
+`ENRICH` enables you to add data from existing indices as new columns using an
+enrich policy. Refer to <> for information about setting up a
+policy.
+
+image::images/esql/esql-enrich.png[align="center"]
+
+TIP: Before you can use `ENRICH`, you need to <>.
+
+*Examples*
+
+// tag::examples[]
+The following example uses the `languages_policy` enrich policy to add a new
+column for each enrich field defined in the policy. The match is performed using
+the `match_field` defined in the <> and
+requires that the input table has a column with the same name (`language_code`
+in this example). `ENRICH` will look for records in the
+<> based on the match field value.
[source.merge.styled,esql]
----
@@ -13,12 +60,8 @@ include::{esql-specs}/docs-ignoreCsvTests.csv-spec[tag=enrich]
include::{esql-specs}/docs-ignoreCsvTests.csv-spec[tag=enrich-result]
|===
-`ENRICH` requires an <> to be executed.
-The enrich policy defines a match field (a key field) and a set of enrich fields.
-
-`ENRICH` will look for records in the <> based on the match field value.
-The matching key in the input dataset can be defined using `ON `; if it's not specified,
-the match will be performed on a field with the same name as the match field defined in the <>.
+To use a column with a different name than the `match_field` defined in the
+policy as the match field, use `ON `:
[source.merge.styled,esql]
----
@@ -29,9 +72,9 @@ include::{esql-specs}/docs-ignoreCsvTests.csv-spec[tag=enrich_on]
include::{esql-specs}/docs-ignoreCsvTests.csv-spec[tag=enrich_on-result]
|===
-
-You can specify which attributes (between those defined as enrich fields in the policy) have to be added to the result,
-using `WITH , ...` syntax.
+By default, each of the enrich fields defined in the policy is added as a
+column. To explicitly select the enrich fields that are added, use
+`WITH , ...`:
[source.merge.styled,esql]
----
@@ -42,8 +85,7 @@ include::{esql-specs}/docs-ignoreCsvTests.csv-spec[tag=enrich_with]
include::{esql-specs}/docs-ignoreCsvTests.csv-spec[tag=enrich_with-result]
|===
-
-Attributes can also be renamed using `WITH new_name=`
+You can rename the columns that are added using `WITH new_name=`:
[source.merge.styled,esql]
----
@@ -54,8 +96,6 @@ include::{esql-specs}/docs-ignoreCsvTests.csv-spec[tag=enrich_rename]
include::{esql-specs}/docs-ignoreCsvTests.csv-spec[tag=enrich_rename-result]
|===
-
-By default (if no `WITH` is defined), `ENRICH` will add all the enrich fields defined in the <>
-to the result.
-
-In case of name collisions, the newly created fields will override the existing fields.
+In case of name collisions, the newly created columns will override existing
+columns.
+// end::examples[]
diff --git a/docs/reference/images/esql/esql-enrich-command.png b/docs/reference/images/esql/esql-enrich-command.png
new file mode 100644
index 0000000000000..934258430d974
Binary files /dev/null and b/docs/reference/images/esql/esql-enrich-command.png differ
diff --git a/docs/reference/images/esql/esql-enrich-policy.png b/docs/reference/images/esql/esql-enrich-policy.png
new file mode 100644
index 0000000000000..abe55e805f1a4
Binary files /dev/null and b/docs/reference/images/esql/esql-enrich-policy.png differ
diff --git a/docs/reference/images/esql/esql-enrich.png b/docs/reference/images/esql/esql-enrich.png
new file mode 100644
index 0000000000000..a710c5e543688
Binary files /dev/null and b/docs/reference/images/esql/esql-enrich.png differ
diff --git a/docs/reference/ingest/apis/enrich/execute-enrich-policy.asciidoc b/docs/reference/ingest/apis/enrich/execute-enrich-policy.asciidoc
index c12f2f12733fd..ee3af9c21de8f 100644
--- a/docs/reference/ingest/apis/enrich/execute-enrich-policy.asciidoc
+++ b/docs/reference/ingest/apis/enrich/execute-enrich-policy.asciidoc
@@ -77,8 +77,9 @@ and are <>.
[WARNING]
====
-Enrich indices should be used by the <> only.
-Avoid using enrich indices for other purposes.
+Enrich indices should only be used by the <>
+or the <>. Avoid using enrich indices for
+other purposes.
====
// end::execute-enrich-policy-def[]
diff --git a/docs/reference/ingest/apis/enrich/put-enrich-policy.asciidoc b/docs/reference/ingest/apis/enrich/put-enrich-policy.asciidoc
index 5981bf9f6d7f7..ee33b0b320905 100644
--- a/docs/reference/ingest/apis/enrich/put-enrich-policy.asciidoc
+++ b/docs/reference/ingest/apis/enrich/put-enrich-policy.asciidoc
@@ -53,7 +53,7 @@ DELETE /_enrich/policy/my-policy
==== {api-prereq-title}
// tag::enrich-policy-api-prereqs[]
-If you use {es} {security-features}, you must have:
+To use enrich policies, you must have:
* `read` index privileges for any indices used
* The `enrich_user` <>
diff --git a/docs/reference/ingest/enrich.asciidoc b/docs/reference/ingest/enrich.asciidoc
index 7b87333cbf416..4688b21d37e7d 100644
--- a/docs/reference/ingest/enrich.asciidoc
+++ b/docs/reference/ingest/enrich.asciidoc
@@ -67,14 +67,16 @@ Directly matching incoming documents to documents in source indices could be
slow and resource intensive. To speed things up, the enrich processor uses an
enrich index.
+// tag::enrich-index[]
Enrich indices contain enrich data from source indices but have a few special
properties to help streamline them:
* They are system indices, meaning they're managed internally by {es} and only
- intended for use with enrich processors.
+ intended for use with enrich processors and the {esql} `ENRICH` command.
* They always begin with `.enrich-*`.
* They are read-only, meaning you can't directly change them.
* They are <> for fast retrieval.
+// end::enrich-index[]
--
[[enrich-setup]]
@@ -115,8 +117,9 @@ include::{es-repo-dir}/ingest/apis/enrich/put-enrich-policy.asciidoc[tag=enrich-
[[create-enrich-source-index]]
==== Add enrich data
+// tag::create-enrich-source-index[]
To begin, add documents to one or more source indices. These documents should
-contain the enrich data you eventually want to add to incoming documents.
+contain the enrich data you eventually want to add to incoming data.
You can manage source indices just like regular {es} indices using the
<> and <> APIs.
@@ -125,29 +128,38 @@ You also can set up {beats-ref}/getting-started.html[{beats}], such as a
{filebeat-ref}/filebeat-installation-configuration.html[{filebeat}], to
automatically send and index documents to your source indices. See
{beats-ref}/getting-started.html[Getting started with {beats}].
+//end::create-enrich-source-index[]
[[create-enrich-policy]]
==== Create an enrich policy
+// tag::create-enrich-policy[]
After adding enrich data to your source indices, use the
-<> to create an enrich policy.
+<> or
+<> to create an enrich policy.
[WARNING]
====
Once created, you can't update or change an enrich policy.
See <>.
====
+// end::create-enrich-policy[]
[[execute-enrich-policy]]
==== Execute the enrich policy
-Once the enrich policy is created, you can execute it using the
-<> to create an
+// tag::execute-enrich-policy1[]
+Once the enrich policy is created, you need to execute it using the
+<> or
+<> to create an
<>.
+// end::execute-enrich-policy1[]
image::images/ingest/enrich/enrich-policy-index.svg[align="center"]
+// tag::execute-enrich-policy2[]
include::apis/enrich/execute-enrich-policy.asciidoc[tag=execute-enrich-policy-def]
+// end::execute-enrich-policy2[]
[[add-enrich-processor]]
==== Add an enrich processor to an ingest pipeline
@@ -208,9 +220,10 @@ Instead, you can:
. Replace the previous enrich policy
with the new enrich policy
- in any in-use enrich processors.
+ in any in-use enrich processors or {esql} queries.
-. Use the <> API
+. Use the <> API or
+<>
to delete the previous enrich policy.
// end::update-enrich-policy[]
diff --git a/docs/reference/redirects.asciidoc b/docs/reference/redirects.asciidoc
index b0a1c157c8cd0..a79ceace09233 100644
--- a/docs/reference/redirects.asciidoc
+++ b/docs/reference/redirects.asciidoc
@@ -1952,4 +1952,3 @@ coming::[8.11.0]
=== Tutorial: Natural language processing (NLP)
coming::[8.11.0]
-
diff --git a/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket/AdjacencyMatrixIT.java b/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket/AdjacencyMatrixIT.java
index ae800b23b12e1..2f3b87d73a223 100644
--- a/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket/AdjacencyMatrixIT.java
+++ b/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket/AdjacencyMatrixIT.java
@@ -35,7 +35,7 @@
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
import static org.elasticsearch.search.aggregations.AggregationBuilders.avg;
import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -102,7 +102,7 @@ public void testSimple() throws Exception {
.addAggregation(adjacencyMatrix("tags", newMap("tag1", termQuery("tag", "tag1")).add("tag2", termQuery("tag", "tag2"))))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
AdjacencyMatrix matrix = response.getAggregations().get("tags");
assertThat(matrix, notNullValue());
@@ -134,7 +134,7 @@ public void testCustomSeparator() throws Exception {
.addAggregation(adjacencyMatrix("tags", "\t", newMap("tag1", termQuery("tag", "tag1")).add("tag2", termQuery("tag", "tag2"))))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
AdjacencyMatrix matrix = response.getAggregations().get("tags");
assertThat(matrix, notNullValue());
@@ -157,7 +157,7 @@ public void testEmptyFilterDeclarations() throws Exception {
.addAggregation(adjacencyMatrix("tags", newMap("all", emptyFilter).add("tag1", termQuery("tag", "tag1"))))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
AdjacencyMatrix filters = response.getAggregations().get("tags");
assertThat(filters, notNullValue());
@@ -180,7 +180,7 @@ public void testWithSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
AdjacencyMatrix matrix = response.getAggregations().get("tags");
assertThat(matrix, notNullValue());
@@ -309,7 +309,7 @@ public void testAsSubAggregation() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
diff --git a/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket/TimeSeriesAggregationsIT.java b/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket/TimeSeriesAggregationsIT.java
index 3100db781172a..381c8d23a1764 100644
--- a/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket/TimeSeriesAggregationsIT.java
+++ b/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket/TimeSeriesAggregationsIT.java
@@ -58,7 +58,6 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.topHits;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -178,7 +177,7 @@ public void setupSuiteScopeCluster() throws Exception {
public void testStandAloneTimeSeriesAgg() {
SearchResponse response = client().prepareSearch("index").setSize(0).addAggregation(timeSeries("by_ts")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Aggregations aggregations = response.getAggregations();
assertNotNull(aggregations);
InternalTimeSeries timeSeries = aggregations.get("by_ts");
@@ -204,7 +203,7 @@ public void testTimeSeriesGroupedByADimension() {
.subAggregation(timeSeries("by_ts"))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Aggregations aggregations = response.getAggregations();
assertNotNull(aggregations);
Terms terms = aggregations.get("by_dim");
@@ -232,7 +231,7 @@ public void testTimeSeriesGroupedByDateHistogram() {
.subAggregation(timeSeries("by_ts").subAggregation(stats("timestamp").field("@timestamp")))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Aggregations aggregations = response.getAggregations();
assertNotNull(aggregations);
Histogram histogram = aggregations.get("by_time");
@@ -272,7 +271,7 @@ public void testStandAloneTimeSeriesAggWithDimFilter() {
.setSize(0)
.addAggregation(timeSeries("by_ts"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Aggregations aggregations = response.getAggregations();
assertNotNull(aggregations);
InternalTimeSeries timeSeries = aggregations.get("by_ts");
@@ -304,7 +303,7 @@ public void testStandAloneTimeSeriesAggWithGlobalAggregation() {
.addAggregation(global("everything").subAggregation(sum("all_sum").field("metric_" + metric)))
.addAggregation(PipelineAggregatorBuilders.sumBucket("total_filter_sum", "by_ts>filter_sum"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Aggregations aggregations = response.getAggregations();
assertNotNull(aggregations);
InternalTimeSeries timeSeries = aggregations.get("by_ts");
@@ -351,7 +350,7 @@ public void testStandAloneTimeSeriesAggWithMetricFilter() {
.setSize(0)
.addAggregation(timeSeries("by_ts"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Aggregations aggregations = response.getAggregations();
assertNotNull(aggregations);
InternalTimeSeries timeSeries = aggregations.get("by_ts");
diff --git a/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/pipeline/DateDerivativeIT.java b/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/pipeline/DateDerivativeIT.java
index 628863387b157..40bde4b2fea21 100644
--- a/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/pipeline/DateDerivativeIT.java
+++ b/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/pipeline/DateDerivativeIT.java
@@ -39,7 +39,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram;
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.equalTo;
@@ -125,7 +125,7 @@ public void testSingleValuedField() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram deriv = response.getAggregations().get("histo");
assertThat(deriv, notNullValue());
@@ -170,7 +170,7 @@ public void testSingleValuedFieldNormalised() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram deriv = response.getAggregations().get("histo");
assertThat(deriv, notNullValue());
@@ -235,7 +235,7 @@ public void testSingleValuedFieldNormalised_timeZone_CET_DstStart() throws Excep
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram deriv = response.getAggregations().get("histo");
assertThat(deriv, notNullValue());
@@ -293,7 +293,7 @@ public void testSingleValuedFieldNormalised_timeZone_CET_DstEnd() throws Excepti
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram deriv = response.getAggregations().get("histo");
assertThat(deriv, notNullValue());
@@ -353,7 +353,7 @@ public void testSingleValuedFieldNormalised_timeZone_AsiaKathmandu() throws Exce
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram deriv = response.getAggregations().get("histo");
assertThat(deriv, notNullValue());
@@ -421,7 +421,7 @@ public void testSingleValuedFieldWithSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -504,7 +504,7 @@ public void testMultiValuedField() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram deriv = response.getAggregations().get("histo");
assertThat(deriv, notNullValue());
@@ -562,7 +562,7 @@ public void testUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram deriv = response.getAggregations().get("histo");
assertThat(deriv, notNullValue());
@@ -580,7 +580,7 @@ public void testPartiallyUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram deriv = response.getAggregations().get("histo");
assertThat(deriv, notNullValue());
diff --git a/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/pipeline/SerialDiffIT.java b/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/pipeline/SerialDiffIT.java
index 324716f0f25ce..b7b93ed5b681d 100644
--- a/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/pipeline/SerialDiffIT.java
+++ b/modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/pipeline/SerialDiffIT.java
@@ -31,7 +31,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.max;
import static org.elasticsearch.search.aggregations.AggregationBuilders.min;
import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.diff;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.equalTo;
@@ -231,7 +231,7 @@ public void testBasicDiff() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
diff --git a/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/MoreExpressionIT.java b/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/MoreExpressionIT.java
index 69b0046e5e207..218b0c7c5157d 100644
--- a/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/MoreExpressionIT.java
+++ b/modules/lang-expression/src/internalClusterTest/java/org/elasticsearch/script/expression/MoreExpressionIT.java
@@ -44,7 +44,6 @@
import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.bucketScript;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
@@ -88,7 +87,7 @@ public void testFunction() throws Exception {
ensureGreen("test");
client().prepareIndex("test").setId("1").setSource("foo", 4).setRefreshPolicy(IMMEDIATE).get();
SearchResponse rsp = buildRequest("doc['foo'] + abs(1)").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
assertEquals(1, rsp.getHits().getTotalHits().value);
assertEquals(5.0, rsp.getHits().getAt(0).field("foo").getValue(), 0.0D);
}
@@ -118,7 +117,7 @@ public void testScore() throws Exception {
req.setQuery(QueryBuilders.functionScoreQuery(QueryBuilders.termQuery("text", "hello"), score).boostMode(CombineFunction.REPLACE));
req.setSearchType(SearchType.DFS_QUERY_THEN_FETCH); // make sure DF is consistent
SearchResponse rsp = req.get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
SearchHits hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals("1", hits.getAt(0).getId());
@@ -223,7 +222,7 @@ public void testMultiValueMethods() throws Exception {
);
SearchResponse rsp = buildRequest("doc['double0'].count() + doc['double1'].count()").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
SearchHits hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals(5.0, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -231,7 +230,7 @@ public void testMultiValueMethods() throws Exception {
assertEquals(5.0, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].sum()").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals(7.5, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -239,7 +238,7 @@ public void testMultiValueMethods() throws Exception {
assertEquals(6.0, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].avg() + doc['double1'].avg()").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals(4.3, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -247,7 +246,7 @@ public void testMultiValueMethods() throws Exception {
assertEquals(5.5, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].median()").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals(1.5, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -255,7 +254,7 @@ public void testMultiValueMethods() throws Exception {
assertEquals(1.25, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].min()").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals(1.0, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -263,7 +262,7 @@ public void testMultiValueMethods() throws Exception {
assertEquals(-1.5, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].max()").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals(5.0, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -271,7 +270,7 @@ public void testMultiValueMethods() throws Exception {
assertEquals(5.0, hits.getAt(2).field("foo").getValue(), 0.0D);
rsp = buildRequest("doc['double0'].sum()/doc['double0'].count()").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals(2.5, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -280,7 +279,7 @@ public void testMultiValueMethods() throws Exception {
// make sure count() works for missing
rsp = buildRequest("doc['double2'].count()").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals(1.0, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -289,7 +288,7 @@ public void testMultiValueMethods() throws Exception {
// make sure .empty works in the same way
rsp = buildRequest("doc['double2'].empty ? 5.0 : 2.0").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
hits = rsp.getHits();
assertEquals(3, hits.getTotalHits().value);
assertEquals(2.0, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -327,7 +326,7 @@ public void testSparseField() throws Exception {
client().prepareIndex("test").setId("2").setSource("id", 2, "y", 2)
);
SearchResponse rsp = buildRequest("doc['x'] + 1").get();
- ElasticsearchAssertions.assertSearchResponse(rsp);
+ assertNoFailures(rsp);
SearchHits hits = rsp.getHits();
assertEquals(2, rsp.getHits().getTotalHits().value);
assertEquals(5.0, hits.getAt(0).field("foo").getValue(), 0.0D);
@@ -640,22 +639,22 @@ public void testGeo() throws Exception {
refresh();
// access .lat
SearchResponse rsp = buildRequest("doc['location'].lat").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
assertEquals(1, rsp.getHits().getTotalHits().value);
assertEquals(61.5240, rsp.getHits().getAt(0).field("foo").getValue(), 1.0D);
// access .lon
rsp = buildRequest("doc['location'].lon").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
assertEquals(1, rsp.getHits().getTotalHits().value);
assertEquals(105.3188, rsp.getHits().getAt(0).field("foo").getValue(), 1.0D);
// access .empty
rsp = buildRequest("doc['location'].empty ? 1 : 0").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
assertEquals(1, rsp.getHits().getTotalHits().value);
assertEquals(0, rsp.getHits().getAt(0).field("foo").getValue(), 1.0D);
// call haversin
rsp = buildRequest("haversin(38.9072, 77.0369, doc['location'].lat, doc['location'].lon)").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
assertEquals(1, rsp.getHits().getTotalHits().value);
assertEquals(3170D, rsp.getHits().getAt(0).field("foo").getValue(), 50D);
}
@@ -678,14 +677,14 @@ public void testBoolean() throws Exception {
);
// access .value
SearchResponse rsp = buildRequest("doc['vip'].value").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
assertEquals(3, rsp.getHits().getTotalHits().value);
assertEquals(1.0D, rsp.getHits().getAt(0).field("foo").getValue(), 1.0D);
assertEquals(0.0D, rsp.getHits().getAt(1).field("foo").getValue(), 1.0D);
assertEquals(0.0D, rsp.getHits().getAt(2).field("foo").getValue(), 1.0D);
// access .empty
rsp = buildRequest("doc['vip'].empty ? 1 : 0").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
assertEquals(3, rsp.getHits().getTotalHits().value);
assertEquals(0.0D, rsp.getHits().getAt(0).field("foo").getValue(), 1.0D);
assertEquals(0.0D, rsp.getHits().getAt(1).field("foo").getValue(), 1.0D);
@@ -693,7 +692,7 @@ public void testBoolean() throws Exception {
// ternary operator
// vip's have a 50% discount
rsp = buildRequest("doc['vip'] ? doc['price']/2 : doc['price']").get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
assertEquals(3, rsp.getHits().getTotalHits().value);
assertEquals(0.5D, rsp.getHits().getAt(0).field("foo").getValue(), 1.0D);
assertEquals(2.0D, rsp.getHits().getAt(1).field("foo").getValue(), 1.0D);
@@ -712,7 +711,7 @@ public void testFilterScript() throws Exception {
Script script = new Script(ScriptType.INLINE, "expression", "doc['foo'].value", Collections.emptyMap());
builder.setQuery(QueryBuilders.boolQuery().filter(QueryBuilders.scriptQuery(script)));
SearchResponse rsp = builder.get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
assertEquals(1, rsp.getHits().getTotalHits().value);
assertEquals(1.0D, rsp.getHits().getAt(0).field("foo").getValue(), 0.0D);
}
diff --git a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/aggregations/ChildrenIT.java b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/aggregations/ChildrenIT.java
index 49d3d04b3ee5c..521a2d31b4156 100644
--- a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/aggregations/ChildrenIT.java
+++ b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/aggregations/ChildrenIT.java
@@ -36,7 +36,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.is;
@@ -50,7 +49,7 @@ public void testSimpleChildrenAgg() {
.addAggregation(children("to_comment", "comment"));
final SearchResponse searchResponse = searchRequest.get();
long count = categoryToControl.values().stream().mapToLong(control -> control.commentIds.size()).sum();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Children childrenAgg = searchResponse.getAggregations().get("to_comment");
assertThat("Request: " + searchRequest + "\nResponse: " + searchResponse + "\n", childrenAgg.getDocCount(), equalTo(count));
}
@@ -68,7 +67,7 @@ public void testChildrenAggs() {
)
)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Terms categoryTerms = searchResponse.getAggregations().get("category");
assertThat(categoryTerms.getBuckets().size(), equalTo(categoryToControl.size()));
@@ -107,7 +106,7 @@ public void testParentWithMultipleBuckets() {
.subAggregation(children("to_comment", "comment").subAggregation(topHits("top_comments").sort("id", SortOrder.ASC)))
)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Terms categoryTerms = searchResponse.getAggregations().get("category");
assertThat(categoryTerms.getBuckets().size(), equalTo(3));
@@ -204,7 +203,7 @@ public void testWithDeletes() throws Exception {
public void testNonExistingChildType() throws Exception {
SearchResponse searchResponse = client().prepareSearch("test").addAggregation(children("non-existing", "xyz")).get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Children children = searchResponse.getAggregations().get("non-existing");
assertThat(children.getName(), equalTo("non-existing"));
diff --git a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/aggregations/ParentIT.java b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/aggregations/ParentIT.java
index 26a8d44759513..7f780090cbd3a 100644
--- a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/aggregations/ParentIT.java
+++ b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/aggregations/ParentIT.java
@@ -27,7 +27,7 @@
import static org.elasticsearch.join.aggregations.JoinAggregationBuilders.parent;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.search.aggregations.AggregationBuilders.topHits;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
public class ParentIT extends AbstractParentChildTestCase {
@@ -39,7 +39,7 @@ public void testSimpleParentAgg() {
.addAggregation(parent("to_article", "comment"));
SearchResponse searchResponse = searchRequest.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
long articlesWithComment = articleToControl.values()
.stream()
.filter(parentControl -> parentControl.commentIds.isEmpty() == false)
@@ -58,7 +58,7 @@ public void testSimpleParentAggWithSubAgg() {
.setQuery(matchQuery("randomized", true))
.addAggregation(parent("to_article", "comment").subAggregation(terms("category").field("category").size(10000)));
SearchResponse searchResponse = searchRequest.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
long articlesWithComment = articleToControl.values()
.stream()
@@ -121,7 +121,7 @@ public void testParentAggs() throws Exception {
)
);
SearchResponse searchResponse = searchRequest.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
final Set commenters = getCommenters();
final Map> commenterToComments = getCommenterToComments();
@@ -201,7 +201,7 @@ private Map> getCommenterToComments() {
public void testNonExistingParentType() throws Exception {
SearchResponse searchResponse = client().prepareSearch("test").addAggregation(parent("non-existing", "xyz")).get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Parent parent = searchResponse.getAggregations().get("non-existing");
assertThat(parent.getName(), equalTo("non-existing"));
@@ -218,7 +218,7 @@ public void testTermsParentAggTerms() throws Exception {
.subAggregation(parent("to_article", "comment").subAggregation(terms("to_category").field("category").size(10000)))
);
SearchResponse searchResponse = searchRequest.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
final Set commenters = getCommenters();
final Map> commenterToComments = getCommenterToComments();
diff --git a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/InnerHitsIT.java b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/InnerHitsIT.java
index 0f8bf4e701e09..23c7802507ae4 100644
--- a/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/InnerHitsIT.java
+++ b/modules/parent-join/src/internalClusterTest/java/org/elasticsearch/join/query/InnerHitsIT.java
@@ -52,6 +52,7 @@
import static org.elasticsearch.join.query.JoinQueryBuilders.hasParentQuery;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCountAndNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHit;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHitsWithoutFailures;
@@ -638,15 +639,14 @@ public void testTooHighResultWindow() {
createIndexRequest("index1", "parent_type", "1", null, "nested_type", Collections.singletonMap("key", "value")).get();
createIndexRequest("index1", "child_type", "2", "1").get();
refresh();
-
- SearchResponse response = client().prepareSearch("index1")
- .setQuery(
- hasChildQuery("child_type", matchAllQuery(), ScoreMode.None).ignoreUnmapped(true)
- .innerHit(new InnerHitBuilder().setFrom(50).setSize(10).setName("_name"))
- )
- .get();
- assertNoFailures(response);
- assertHitCount(response, 1);
+ assertHitCountAndNoFailures(
+ client().prepareSearch("index1")
+ .setQuery(
+ hasChildQuery("child_type", matchAllQuery(), ScoreMode.None).ignoreUnmapped(true)
+ .innerHit(new InnerHitBuilder().setFrom(50).setSize(10).setName("_name"))
+ ),
+ 1
+ );
Exception e = expectThrows(
SearchPhaseExecutionException.class,
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java
index 2155192414246..9aa78f44881e2 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/aliases/IndexAliasesIT.java
@@ -64,7 +64,7 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertBlocked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.emptyArray;
@@ -288,7 +288,7 @@ public void testSearchingFilteringAliasesSingleIndex() throws Exception {
.setQuery(QueryBuilders.matchQuery("name", "bar"))
.addAggregation(AggregationBuilders.global("global").subAggregation(AggregationBuilders.terms("test").field("name")))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Global global = searchResponse.getAggregations().get("global");
Terms terms = global.getAggregations().get("test");
assertThat(terms.getBuckets().size(), equalTo(4));
@@ -299,7 +299,7 @@ public void testSearchingFilteringAliasesSingleIndex() throws Exception {
.addAggregation(AggregationBuilders.global("global").subAggregation(AggregationBuilders.terms("test").field("name")))
.addSort("_index", SortOrder.ASC)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
global = searchResponse.getAggregations().get("global");
terms = global.getAggregations().get("test");
assertThat(terms.getBuckets().size(), equalTo(4));
@@ -310,7 +310,7 @@ public void testSearchingFilteringAliasesSingleIndex() throws Exception {
.addAggregation(AggregationBuilders.terms("test").field("name"))
.addSort("_index", SortOrder.ASC)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
terms = searchResponse.getAggregations().get("test");
assertThat(terms.getBuckets().size(), equalTo(2));
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/index/store/ExceptionRetryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/index/store/ExceptionRetryIT.java
index 8b1c44703569f..b1b3a6850c061 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/index/store/ExceptionRetryIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/index/store/ExceptionRetryIT.java
@@ -39,7 +39,7 @@
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
@@ -130,7 +130,7 @@ public void testRetryDueToExceptionOnNetworkLayer() throws ExecutionException, I
dupCounter++;
}
}
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(dupCounter, equalTo(0L));
assertHitCount(searchResponse, numDocs);
IndicesStatsResponse index = indicesAdmin().prepareStats("index").clear().setSegments(true).get();
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/indices/IndicesRequestCacheIT.java b/server/src/internalClusterTest/java/org/elasticsearch/indices/IndicesRequestCacheIT.java
index 8ad81104eab2f..93a19e5d921b5 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/indices/IndicesRequestCacheIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/indices/IndicesRequestCacheIT.java
@@ -35,7 +35,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.dateRange;
import static org.elasticsearch.search.aggregations.AggregationBuilders.filter;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
@@ -67,7 +67,7 @@ public void testCacheAggs() throws Exception {
dateHistogram("histo").field("f").timeZone(ZoneId.of("+01:00")).minDocCount(0).calendarInterval(DateHistogramInterval.MONTH)
)
.get();
- assertSearchResponse(r1);
+ assertNoFailures(r1);
// The cached is actually used
assertThat(
@@ -86,7 +86,7 @@ public void testCacheAggs() throws Exception {
.calendarInterval(DateHistogramInterval.MONTH)
)
.get();
- assertSearchResponse(r2);
+ assertNoFailures(r2);
Histogram h1 = r1.getAggregations().get("histo");
Histogram h2 = r2.getAggregations().get("histo");
final List extends Bucket> buckets1 = h1.getBuckets();
@@ -530,7 +530,7 @@ public void testProfileDisableCache() throws Exception {
.setProfile(profile)
.setQuery(QueryBuilders.termQuery("k", "hello"))
.get();
- assertSearchResponse(resp);
+ assertNoFailures(resp);
ElasticsearchAssertions.assertAllSuccessful(resp);
assertThat(resp.getHits().getTotalHits().value, equalTo(1L));
if (profile == false) {
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/StressSearchServiceReaperIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/StressSearchServiceReaperIT.java
index d09fb6e32e40f..c194674d1d99f 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/StressSearchServiceReaperIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/StressSearchServiceReaperIT.java
@@ -9,7 +9,6 @@
import org.apache.lucene.tests.util.English;
import org.elasticsearch.action.index.IndexRequestBuilder;
-import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.core.TimeValue;
import org.elasticsearch.test.ESIntegTestCase;
@@ -19,8 +18,7 @@
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.test.ESIntegTestCase.Scope.SUITE;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCountAndNoFailures;
@ClusterScope(scope = SUITE)
public class StressSearchServiceReaperIT extends ESIntegTestCase {
@@ -45,9 +43,7 @@ public void testStressReaper() throws ExecutionException, InterruptedException {
indexRandom(true, builders);
final int iterations = scaledRandomIntBetween(500, 1000);
for (int i = 0; i < iterations; i++) {
- SearchResponse searchResponse = client().prepareSearch("test").setQuery(matchAllQuery()).setSize(num).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, num);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(matchAllQuery()).setSize(num), num);
}
}
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/AggregationsIntegrationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/AggregationsIntegrationIT.java
index d6b9cb0ac267c..0c940ad1f3154 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/AggregationsIntegrationIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/AggregationsIntegrationIT.java
@@ -19,7 +19,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
@ESIntegTestCase.SuiteScopeTestCase
public class AggregationsIntegrationIT extends ESIntegTestCase {
@@ -44,7 +44,7 @@ public void testScroll() {
.setScroll(TimeValue.timeValueMinutes(1))
.addAggregation(terms("f").field("f"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Aggregations aggregations = response.getAggregations();
assertNotNull(aggregations);
Terms terms = aggregations.get("f");
@@ -53,7 +53,7 @@ public void testScroll() {
int total = response.getHits().getHits().length;
while (response.getHits().getHits().length > 0) {
response = client().prepareSearchScroll(response.getScrollId()).setScroll(TimeValue.timeValueMinutes(1)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertNull(response.getAggregations());
total += response.getHits().getHits().length;
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/CombiIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/CombiIT.java
index 683ccb975b9fb..9c8786206264f 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/CombiIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/CombiIT.java
@@ -24,7 +24,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram;
import static org.elasticsearch.search.aggregations.AggregationBuilders.missing;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.CoreMatchers.equalTo;
import static org.hamcrest.CoreMatchers.is;
@@ -66,7 +66,7 @@ public void testMultipleAggsOnSameField_WithDifferentRequiredValueSourceType() t
.addAggregation(terms("values").field("value").collectMode(aggCollectionMode))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Aggregations aggs = response.getAggregations();
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/EquivalenceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/EquivalenceIT.java
index 4352c0962c7df..f8e6ed5193e9c 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/EquivalenceIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/EquivalenceIT.java
@@ -57,7 +57,6 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.core.IsNull.notNullValue;
@@ -367,7 +366,7 @@ public void testDuelTermsHistogram() throws Exception {
.addAggregation(histogram("histo").field("values").interval(interval).minDocCount(1))
.get();
- assertSearchResponse(resp);
+ assertNoFailures(resp);
Terms terms = resp.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -427,7 +426,7 @@ public void testReduce() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filter filter = response.getAggregations().get("filter");
assertNotNull(filter);
@@ -493,7 +492,7 @@ public void testDuelDepthBreadthFirst() throws Exception {
)
)
.get();
- assertSearchResponse(r1);
+ assertNoFailures(r1);
final SearchResponse r2 = client().prepareSearch("idx")
.addAggregation(
terms("f1").field("f1")
@@ -505,7 +504,7 @@ public void testDuelDepthBreadthFirst() throws Exception {
)
)
.get();
- assertSearchResponse(r2);
+ assertNoFailures(r2);
final Terms t1 = r1.getAggregations().get("f1");
final Terms t2 = r2.getAggregations().get("f1");
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MetadataIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MetadataIT.java
index f5283b979c722..0cfd27f03c6e1 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MetadataIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MetadataIT.java
@@ -22,7 +22,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.maxBucket;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
public class MetadataIT extends ESIntegTestCase {
@@ -46,7 +46,7 @@ public void testMetadataSetOnAggregationResult() throws Exception {
.addAggregation(maxBucket("the_max_bucket", "the_terms>the_sum").setMetadata(metadata))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Aggregations aggs = response.getAggregations();
assertNotNull(aggs);
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MissingValueIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MissingValueIT.java
index 96636b57f2774..6ad46d7a77ee8 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MissingValueIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/MissingValueIT.java
@@ -30,7 +30,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.stats;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.closeTo;
@ESIntegTestCase.SuiteScopeTestCase
@@ -57,7 +57,7 @@ public void testUnmappedTerms() {
SearchResponse response = client().prepareSearch("idx")
.addAggregation(terms("my_terms").field("non_existing_field").missing("bar"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("my_terms");
assertEquals(1, terms.getBuckets().size());
assertEquals(2, terms.getBucketByKey("bar").getDocCount());
@@ -68,14 +68,14 @@ public void testStringTerms() {
SearchResponse response = client().prepareSearch("idx")
.addAggregation(terms("my_terms").field("str").executionHint(mode.toString()).missing("bar"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("my_terms");
assertEquals(2, terms.getBuckets().size());
assertEquals(1, terms.getBucketByKey("foo").getDocCount());
assertEquals(1, terms.getBucketByKey("bar").getDocCount());
response = client().prepareSearch("idx").addAggregation(terms("my_terms").field("str").missing("foo")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
terms = response.getAggregations().get("my_terms");
assertEquals(1, terms.getBuckets().size());
assertEquals(2, terms.getBucketByKey("foo").getDocCount());
@@ -84,14 +84,14 @@ public void testStringTerms() {
public void testLongTerms() {
SearchResponse response = client().prepareSearch("idx").addAggregation(terms("my_terms").field("long").missing(4)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("my_terms");
assertEquals(2, terms.getBuckets().size());
assertEquals(1, terms.getBucketByKey("3").getDocCount());
assertEquals(1, terms.getBucketByKey("4").getDocCount());
response = client().prepareSearch("idx").addAggregation(terms("my_terms").field("long").missing(3)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
terms = response.getAggregations().get("my_terms");
assertEquals(1, terms.getBuckets().size());
assertEquals(2, terms.getBucketByKey("3").getDocCount());
@@ -99,14 +99,14 @@ public void testLongTerms() {
public void testDoubleTerms() {
SearchResponse response = client().prepareSearch("idx").addAggregation(terms("my_terms").field("double").missing(4.5)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("my_terms");
assertEquals(2, terms.getBuckets().size());
assertEquals(1, terms.getBucketByKey("4.5").getDocCount());
assertEquals(1, terms.getBucketByKey("5.5").getDocCount());
response = client().prepareSearch("idx").addAggregation(terms("my_terms").field("double").missing(5.5)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
terms = response.getAggregations().get("my_terms");
assertEquals(1, terms.getBuckets().size());
assertEquals(2, terms.getBucketByKey("5.5").getDocCount());
@@ -116,7 +116,7 @@ public void testUnmappedHistogram() {
SearchResponse response = client().prepareSearch("idx")
.addAggregation(histogram("my_histogram").field("non-existing_field").interval(5).missing(12))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histogram = response.getAggregations().get("my_histogram");
assertEquals(1, histogram.getBuckets().size());
assertEquals(10d, histogram.getBuckets().get(0).getKey());
@@ -127,7 +127,7 @@ public void testHistogram() {
SearchResponse response = client().prepareSearch("idx")
.addAggregation(histogram("my_histogram").field("long").interval(5).missing(7))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histogram = response.getAggregations().get("my_histogram");
assertEquals(2, histogram.getBuckets().size());
assertEquals(0d, histogram.getBuckets().get(0).getKey());
@@ -136,7 +136,7 @@ public void testHistogram() {
assertEquals(1, histogram.getBuckets().get(1).getDocCount());
response = client().prepareSearch("idx").addAggregation(histogram("my_histogram").field("long").interval(5).missing(3)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
histogram = response.getAggregations().get("my_histogram");
assertEquals(1, histogram.getBuckets().size());
assertEquals(0d, histogram.getBuckets().get(0).getKey());
@@ -147,7 +147,7 @@ public void testDateHistogram() {
SearchResponse response = client().prepareSearch("idx")
.addAggregation(dateHistogram("my_histogram").field("date").calendarInterval(DateHistogramInterval.YEAR).missing("2014-05-07"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histogram = response.getAggregations().get("my_histogram");
assertEquals(2, histogram.getBuckets().size());
assertEquals("2014-01-01T00:00:00.000Z", histogram.getBuckets().get(0).getKeyAsString());
@@ -158,7 +158,7 @@ public void testDateHistogram() {
response = client().prepareSearch("idx")
.addAggregation(dateHistogram("my_histogram").field("date").calendarInterval(DateHistogramInterval.YEAR).missing("2015-05-07"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
histogram = response.getAggregations().get("my_histogram");
assertEquals(1, histogram.getBuckets().size());
assertEquals("2015-01-01T00:00:00.000Z", histogram.getBuckets().get(0).getKeyAsString());
@@ -167,7 +167,7 @@ public void testDateHistogram() {
public void testCardinality() {
SearchResponse response = client().prepareSearch("idx").addAggregation(cardinality("card").field("long").missing(2)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Cardinality cardinality = response.getAggregations().get("card");
assertEquals(2, cardinality.getValue());
}
@@ -176,14 +176,14 @@ public void testPercentiles() {
SearchResponse response = client().prepareSearch("idx")
.addAggregation(percentiles("percentiles").field("long").missing(1000))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Percentiles percentiles = response.getAggregations().get("percentiles");
assertEquals(1000, percentiles.percentile(100), 0);
}
public void testStats() {
SearchResponse response = client().prepareSearch("idx").addAggregation(stats("stats").field("long").missing(5)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Stats stats = response.getAggregations().get("stats");
assertEquals(2, stats.getCount());
assertEquals(4, stats.getAvg(), 0);
@@ -193,7 +193,7 @@ public void testUnmappedGeoBounds() {
SearchResponse response = client().prepareSearch("idx")
.addAggregation(geoBounds("bounds").field("non_existing_field").missing("2,1"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoBounds bounds = response.getAggregations().get("bounds");
assertThat(bounds.bottomRight().lat(), closeTo(2.0, 1E-5));
assertThat(bounds.bottomRight().lon(), closeTo(1.0, 1E-5));
@@ -203,7 +203,7 @@ public void testUnmappedGeoBounds() {
public void testGeoBounds() {
SearchResponse response = client().prepareSearch("idx").addAggregation(geoBounds("bounds").field("location").missing("2,1")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoBounds bounds = response.getAggregations().get("bounds");
assertThat(bounds.bottomRight().lat(), closeTo(1.0, 1E-5));
assertThat(bounds.bottomRight().lon(), closeTo(2.0, 1E-5));
@@ -215,7 +215,7 @@ public void testGeoCentroid() {
SearchResponse response = client().prepareSearch("idx")
.addAggregation(geoCentroid("centroid").field("location").missing("2,1"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoCentroid centroid = response.getAggregations().get("centroid");
GeoPoint point = new GeoPoint(1.5, 1.5);
assertThat(point.getY(), closeTo(centroid.centroid().getY(), 1E-5));
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/BooleanTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/BooleanTermsIT.java
index 795a72310cb2f..3f94cde9cb30a 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/BooleanTermsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/BooleanTermsIT.java
@@ -15,7 +15,7 @@
import org.elasticsearch.search.aggregations.bucket.terms.UnmappedTerms;
import org.elasticsearch.test.ESIntegTestCase;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
@@ -79,7 +79,7 @@ public void testSingleValueField() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -113,7 +113,7 @@ public void testMultiValueField() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -149,7 +149,7 @@ public void testUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
UnmappedTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java
index 62a8a5c9dee98..8333fcd37ea37 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateHistogramIT.java
@@ -60,8 +60,8 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.stats;
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
@@ -229,7 +229,7 @@ public void testSingleValuedField() throws Exception {
.addAggregation(dateHistogram("histo").field("date").calendarInterval(DateHistogramInterval.MONTH))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -270,7 +270,7 @@ public void testSingleValuedFieldWithTimeZone() throws Exception {
.execute()
.actionGet();
ZoneId tz = ZoneId.of("+01:00");
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -333,7 +333,7 @@ public void testSingleValued_timeZone_epoch() throws Exception {
dateHistogram("histo").field("date").calendarInterval(DateHistogramInterval.DAY).minDocCount(1).timeZone(tz).format(format)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -366,7 +366,7 @@ public void testSingleValuedFieldOrderedByKeyAsc() throws Exception {
.addAggregation(dateHistogram("histo").field("date").calendarInterval(DateHistogramInterval.MONTH).order(BucketOrder.key(true)))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -388,7 +388,7 @@ public void testSingleValuedFieldOrderedByKeyDesc() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -409,7 +409,7 @@ public void testSingleValuedFieldOrderedByCountAsc() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -430,7 +430,7 @@ public void testSingleValuedFieldOrderedByCountDesc() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -451,7 +451,7 @@ public void testSingleValuedFieldWithSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -513,7 +513,7 @@ public void testSingleValuedFieldOrderedBySubAggregationAsc() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -537,7 +537,7 @@ public void testSingleValuedFieldOrderedBySubAggregationDesc() throws Exception
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -561,7 +561,7 @@ public void testSingleValuedFieldOrderedByMultiValuedSubAggregationDesc() throws
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -585,7 +585,7 @@ public void testSingleValuedFieldOrderedByTieBreaker() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -641,7 +641,7 @@ public void testSingleValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -686,7 +686,7 @@ public void testMultiValuedField() throws Exception {
.addAggregation(dateHistogram("histo").field("dates").calendarInterval(DateHistogramInterval.MONTH))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -730,7 +730,7 @@ public void testMultiValuedFieldOrderedByCountDesc() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -781,7 +781,7 @@ public void testMultiValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -836,7 +836,7 @@ public void testScriptSingleValue() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -876,7 +876,7 @@ public void testScriptMultiValued() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -927,7 +927,7 @@ public void testUnmapped() throws Exception {
.addAggregation(dateHistogram("histo").field("date").calendarInterval(DateHistogramInterval.MONTH))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -940,7 +940,7 @@ public void testPartiallyUnmapped() throws Exception {
.addAggregation(dateHistogram("histo").field("date").calendarInterval(DateHistogramInterval.MONTH))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -1130,7 +1130,7 @@ public void testSingleValueFieldWithExtendedBounds() throws Exception {
throw e;
}
}
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -1187,7 +1187,7 @@ public void testSingleValueFieldWithExtendedBoundsTimezone() throws Exception {
.extendedBounds(new LongBounds("now/d", "now/d+23h"))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(
"Expected 24 buckets for one day aggregation with hourly interval",
@@ -1245,7 +1245,7 @@ public void testSingleValueFieldWithExtendedBoundsOffset() throws Exception {
.extendedBounds(new LongBounds("2016-01-01T06:00:00Z", "2016-01-08T08:00:00Z"))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -1322,7 +1322,7 @@ public void testIssue6965() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
ZoneId tz = ZoneId.of("+01:00");
@@ -1370,7 +1370,7 @@ public void testDSTBoundaryIssue9491() throws InterruptedException, ExecutionExc
.format("yyyy-MM-dd'T'HH:mm:ss.SSSXXXXX")
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo.getBuckets().size(), equalTo(1));
assertThat(histo.getBuckets().get(0).getKeyAsString(), equalTo("2014-01-01T00:00:00.000+02:00"));
@@ -1395,7 +1395,7 @@ public void testIssue8209() throws InterruptedException, ExecutionException {
.minDocCount(0)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo.getBuckets().size(), equalTo(4));
assertThat(histo.getBuckets().get(0).getKeyAsString(), equalTo("2014-01-01T00:00:00.000+01:00"));
@@ -1432,7 +1432,7 @@ public void testFormatIndexUnmapped() throws InterruptedException, ExecutionExce
.extendedBounds(new LongBounds("2018-01", "2018-01"))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo.getBuckets().size(), equalTo(1));
assertThat(histo.getBuckets().get(0).getKeyAsString(), equalTo("2018-01"));
@@ -1455,7 +1455,7 @@ public void testRewriteTimeZone_EpochMillisFormat() throws InterruptedException,
dateHistogram("histo").field("d").calendarInterval(DateHistogramInterval.MONTH).timeZone(ZoneId.of("Europe/Berlin"))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo.getBuckets().size(), equalTo(1));
assertThat(histo.getBuckets().get(0).getKeyAsString(), equalTo("1477954800000"));
@@ -1469,7 +1469,7 @@ public void testRewriteTimeZone_EpochMillisFormat() throws InterruptedException,
.format("yyyy-MM-dd")
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
histo = response.getAggregations().get("histo");
assertThat(histo.getBuckets().size(), equalTo(1));
assertThat(histo.getBuckets().get(0).getKeyAsString(), equalTo("2016-11-01"));
@@ -1586,7 +1586,7 @@ public void testScriptCaching() throws Exception {
.calendarInterval(DateHistogramInterval.MONTH)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1606,7 +1606,7 @@ public void testScriptCaching() throws Exception {
.calendarInterval(DateHistogramInterval.MONTH)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1622,7 +1622,7 @@ public void testScriptCaching() throws Exception {
.setSize(0)
.addAggregation(dateHistogram("histo").field("d").calendarInterval(DateHistogramInterval.MONTH))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1686,7 +1686,7 @@ private void assertMultiSortResponse(int[] expectedDays, BucketOrder... order) {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histogram = response.getAggregations().get("histo");
assertThat(histogram, notNullValue());
@@ -1730,7 +1730,7 @@ public void testDateNanosHistogram() throws Exception {
)
.addDocValueField("date")
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
Histogram histogram = r.getAggregations().get("histo");
List extends Bucket> buckets = histogram.getBuckets();
@@ -1746,7 +1746,7 @@ public void testDateNanosHistogram() throws Exception {
)
.addDocValueField("date")
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
histogram = r.getAggregations().get("histo");
buckets = histogram.getBuckets();
@@ -1764,7 +1764,7 @@ public void testDateKeyFormatting() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
InternalDateHistogram histogram = response.getAggregations().get("histo");
List buckets = histogram.getBuckets();
@@ -1782,7 +1782,7 @@ public void testHardBoundsOnDates() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
InternalDateHistogram histogram = response.getAggregations().get("histo");
List buckets = histogram.getBuckets();
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateRangeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateRangeIT.java
index 27fb5c49df605..d0e7a74c9feab 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateRangeIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DateRangeIT.java
@@ -42,7 +42,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram;
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -136,7 +136,7 @@ public void testDateMath() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -171,7 +171,7 @@ public void testSingleValueField() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -217,7 +217,7 @@ public void testSingleValueFieldWithStringDates() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -264,7 +264,7 @@ public void testSingleValueFieldWithStringDatesWithCustomFormat() throws Excepti
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -318,7 +318,7 @@ public void testSingleValueFieldWithDateMath() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -364,7 +364,7 @@ public void testSingleValueFieldWithCustomKey() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -420,7 +420,7 @@ public void testSingleValuedFieldWithSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -495,7 +495,7 @@ public void testMultiValuedField() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -541,7 +541,7 @@ public void testPartiallyUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -661,7 +661,7 @@ public void testScriptCaching() throws Exception {
)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -684,7 +684,7 @@ public void testScriptCaching() throws Exception {
)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -706,7 +706,7 @@ public void testScriptCaching() throws Exception {
)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DiversifiedSamplerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DiversifiedSamplerIT.java
index e9180f5d8b9f2..ac0dbf6f5d0a6 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DiversifiedSamplerIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DiversifiedSamplerIT.java
@@ -28,7 +28,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.sampler;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
@@ -101,7 +101,7 @@ public void testIssue10719() throws Exception {
.subAggregation(sampler("sample").shardSize(100).subAggregation(max("max_price").field("price")))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms genres = response.getAggregations().get("genres");
Collection extends Bucket> genreBuckets = genres.getBuckets();
// For this test to be useful we need >1 genre bucket to compare
@@ -133,7 +133,7 @@ public void testSimpleDiversity() throws Exception {
.setSize(60)
.addAggregation(sampleAgg)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Sampler sample = response.getAggregations().get("sample");
Terms authors = sample.getAggregations().get("authors");
List extends Bucket> testBuckets = authors.getBuckets();
@@ -154,7 +154,7 @@ public void testNestedDiversity() throws Exception {
rootTerms.subAggregation(sampleAgg);
SearchResponse response = client().prepareSearch("test").setSearchType(SearchType.QUERY_THEN_FETCH).addAggregation(rootTerms).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms genres = response.getAggregations().get("genres");
List extends Bucket> genreBuckets = genres.getBuckets();
for (Terms.Bucket genreBucket : genreBuckets) {
@@ -186,7 +186,7 @@ public void testNestedSamples() throws Exception {
.setSearchType(SearchType.QUERY_THEN_FETCH)
.addAggregation(rootSample)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Sampler genreSample = response.getAggregations().get("genreSample");
Sampler sample = genreSample.getAggregations().get("sample");
@@ -217,7 +217,7 @@ public void testPartiallyUnmappedDiversifyField() throws Exception {
.setSize(60)
.addAggregation(sampleAgg)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Sampler sample = response.getAggregations().get("sample");
assertThat(sample.getDocCount(), greaterThan(0L));
Terms authors = sample.getAggregations().get("authors");
@@ -237,7 +237,7 @@ public void testWhollyUnmappedDiversifyField() throws Exception {
.setSize(60)
.addAggregation(sampleAgg)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Sampler sample = response.getAggregations().get("sample");
assertThat(sample.getDocCount(), equalTo(0L));
Terms authors = sample.getAggregations().get("authors");
@@ -256,7 +256,7 @@ public void testRidiculousSizeDiversity() throws Exception {
.setSize(60)
.addAggregation(sampleAgg)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
sampleAgg = new DiversifiedAggregationBuilder("sample").shardSize(100);
sampleAgg.field("author").maxDocsPerValue(Integer.MAX_VALUE).executionHint(randomExecutionHint());
@@ -268,7 +268,7 @@ public void testRidiculousSizeDiversity() throws Exception {
.setSize(60)
.addAggregation(sampleAgg)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
}
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DoubleTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DoubleTermsIT.java
index 1e4cfb444d47e..1664db2060e0d 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DoubleTermsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/DoubleTermsIT.java
@@ -54,7 +54,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.stats;
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -282,7 +282,7 @@ private void runTestFieldWithPartitionedFiltering(String field) throws Exception
new TermsAggregationBuilder("terms").field(field).size(10000).collectMode(randomFrom(SubAggCollectionMode.values()))
)
.get();
- assertSearchResponse(allResponse);
+ assertNoFailures(allResponse);
DoubleTerms terms = allResponse.getAggregations().get("terms");
assertThat(terms, notNullValue());
assertThat(terms.getName(), equalTo("terms"));
@@ -299,7 +299,7 @@ private void runTestFieldWithPartitionedFiltering(String field) throws Exception
.collectMode(randomFrom(SubAggCollectionMode.values()))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
assertThat(terms.getName(), equalTo("terms"));
@@ -320,7 +320,7 @@ public void testSingleValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -345,7 +345,7 @@ public void testMultiValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -374,7 +374,7 @@ public void testMultiValuedFieldWithValueScriptNotUnique() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -421,7 +421,7 @@ public void testScriptSingleValue() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -453,7 +453,7 @@ public void testScriptMultiValued() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -480,7 +480,7 @@ public void testPartiallyUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -505,7 +505,7 @@ public void testPartiallyUnmappedWithFormat() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -537,7 +537,7 @@ public void testSingleValuedFieldOrderedBySingleValueSubAggregationAscWithSubTer
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -578,7 +578,7 @@ public void testSingleValuedFieldOrderedBySingleBucketSubAggregationAsc() throws
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms tags = response.getAggregations().get("num_tags");
assertThat(tags, notNullValue());
@@ -619,7 +619,7 @@ public void testSingleValuedFieldOrderedBySubAggregationAscMultiHierarchyLevels(
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms tags = response.getAggregations().get("tags");
assertThat(tags, notNullValue());
@@ -759,7 +759,7 @@ public void testSingleValuedFieldOrderedByMultiValueSubAggregationAsc() throws E
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -789,7 +789,7 @@ public void testSingleValuedFieldOrderedByMultiValueSubAggregationDesc() throws
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -819,7 +819,7 @@ public void testSingleValuedFieldOrderedByMultiValueExtendedStatsAsc() throws Ex
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -863,7 +863,7 @@ public void testScriptScore() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -930,7 +930,7 @@ private void assertMultiSortResponse(double[] expectedKeys, BucketOrder... order
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
DoubleTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -990,7 +990,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "Math.random()", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1009,7 +1009,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_value + 1", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1022,7 +1022,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(new TermsAggregationBuilder("terms").field("d")).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FilterIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FilterIT.java
index 4d799cbbea6b5..065bb5924e049 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FilterIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FilterIT.java
@@ -28,7 +28,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.avg;
import static org.elasticsearch.search.aggregations.AggregationBuilders.filter;
import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
@@ -81,7 +81,7 @@ public void setupSuiteScopeCluster() throws Exception {
public void testSimple() throws Exception {
SearchResponse response = client().prepareSearch("idx").addAggregation(filter("tag1", termQuery("tag", "tag1"))).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filter filter = response.getAggregations().get("tag1");
assertThat(filter, notNullValue());
@@ -95,7 +95,7 @@ public void testEmptyFilterDeclarations() throws Exception {
QueryBuilder emptyFilter = new BoolQueryBuilder();
SearchResponse response = client().prepareSearch("idx").addAggregation(filter("tag1", emptyFilter)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filter filter = response.getAggregations().get("tag1");
assertThat(filter, notNullValue());
@@ -107,7 +107,7 @@ public void testWithSubAggregation() throws Exception {
.addAggregation(filter("tag1", termQuery("tag", "tag1")).subAggregation(avg("avg_value").field("value")))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filter filter = response.getAggregations().get("tag1");
assertThat(filter, notNullValue());
@@ -132,7 +132,7 @@ public void testAsSubAggregation() {
.addAggregation(histogram("histo").field("value").interval(2L).subAggregation(filter("filter", matchAllQuery())))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FiltersIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FiltersIT.java
index 68acd22ce6c55..9e86c4ec80d4d 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FiltersIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/FiltersIT.java
@@ -34,7 +34,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.avg;
import static org.elasticsearch.search.aggregations.AggregationBuilders.filters;
import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
@@ -107,7 +107,7 @@ public void testSimple() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filters filters = response.getAggregations().get("tags");
assertThat(filters, notNullValue());
@@ -134,7 +134,7 @@ public void testEmptyFilterDeclarations() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filters filters = response.getAggregations().get("tags");
assertThat(filters, notNullValue());
@@ -156,7 +156,7 @@ public void testWithSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filters filters = response.getAggregations().get("tags");
assertThat(filters, notNullValue());
@@ -206,7 +206,7 @@ public void testAsSubAggregation() {
.addAggregation(histogram("histo").field("value").interval(2L).subAggregation(filters("filters", matchAllQuery())))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -273,7 +273,7 @@ public void testSimpleNonKeyed() throws Exception {
.addAggregation(filters("tags", termQuery("tag", "tag1"), termQuery("tag", "tag2")))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filters filters = response.getAggregations().get("tags");
assertThat(filters, notNullValue());
@@ -303,7 +303,7 @@ public void testOtherBucket() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filters filters = response.getAggregations().get("tags");
assertThat(filters, notNullValue());
@@ -334,7 +334,7 @@ public void testOtherNamedBucket() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filters filters = response.getAggregations().get("tags");
assertThat(filters, notNullValue());
@@ -360,7 +360,7 @@ public void testOtherNonKeyed() throws Exception {
.addAggregation(filters("tags", termQuery("tag", "tag1"), termQuery("tag", "tag2")).otherBucket(true))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filters filters = response.getAggregations().get("tags");
assertThat(filters, notNullValue());
@@ -394,7 +394,7 @@ public void testOtherWithSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filters filters = response.getAggregations().get("tags");
assertThat(filters, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceIT.java
index df3f1b3e0fdb3..a7dee3b1507ee 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoDistanceIT.java
@@ -39,7 +39,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.geoDistance;
import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
@@ -144,7 +144,7 @@ public void testSimple() throws Exception {
}
SearchResponse response = client().prepareSearch("idx").addAggregation(builder).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range geoDist = response.getAggregations().get("amsterdam_rings");
assertThat(geoDist, notNullValue());
@@ -191,7 +191,7 @@ public void testSimpleWithCustomKeys() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range geoDist = response.getAggregations().get("amsterdam_rings");
assertThat(geoDist, notNullValue());
@@ -240,7 +240,7 @@ public void testUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range geoDist = response.getAggregations().get("amsterdam_rings");
assertThat(geoDist, notNullValue());
@@ -287,7 +287,7 @@ public void testPartiallyUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range geoDist = response.getAggregations().get("amsterdam_rings");
assertThat(geoDist, notNullValue());
@@ -335,7 +335,7 @@ public void testWithSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range geoDist = response.getAggregations().get("amsterdam_rings");
assertThat(geoDist, notNullValue());
@@ -462,7 +462,7 @@ public void testMultiValues() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range geoDist = response.getAggregations().get("amsterdam_rings");
assertThat(geoDist, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java
index 151de82117bc1..078cc9761fb26 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GeoHashGridIT.java
@@ -36,7 +36,7 @@
import static org.elasticsearch.geometry.utils.Geohash.stringEncode;
import static org.elasticsearch.search.aggregations.AggregationBuilders.geohashGrid;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -136,7 +136,7 @@ public void testSimple() throws Exception {
.addAggregation(geohashGrid("geohashgrid").field("location").precision(precision))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoGrid geoGrid = response.getAggregations().get("geohashgrid");
List extends Bucket> buckets = geoGrid.getBuckets();
@@ -163,7 +163,7 @@ public void testMultivalued() throws Exception {
.addAggregation(geohashGrid("geohashgrid").field("location").precision(precision))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoGrid geoGrid = response.getAggregations().get("geohashgrid");
for (GeoGrid.Bucket cell : geoGrid.getBuckets()) {
@@ -188,7 +188,7 @@ public void testFiltered() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filter filter = response.getAggregations().get("filtered");
@@ -211,7 +211,7 @@ public void testUnmapped() throws Exception {
.addAggregation(geohashGrid("geohashgrid").field("location").precision(precision))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoGrid geoGrid = response.getAggregations().get("geohashgrid");
assertThat(geoGrid.getBuckets().size(), equalTo(0));
@@ -225,7 +225,7 @@ public void testPartiallyUnmapped() throws Exception {
.addAggregation(geohashGrid("geohashgrid").field("location").precision(precision))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoGrid geoGrid = response.getAggregations().get("geohashgrid");
for (GeoGrid.Bucket cell : geoGrid.getBuckets()) {
@@ -245,7 +245,7 @@ public void testTopMatch() throws Exception {
.addAggregation(geohashGrid("geohashgrid").field("location").size(1).shardSize(100).precision(precision))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoGrid geoGrid = response.getAggregations().get("geohashgrid");
// Check we only have one bucket with the best match for that resolution
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GlobalIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GlobalIT.java
index 1ccb47a8517c4..80133961ad73a 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GlobalIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/GlobalIT.java
@@ -21,7 +21,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.global;
import static org.elasticsearch.search.aggregations.AggregationBuilders.stats;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
@@ -65,7 +65,7 @@ public void testWithStatsSubAggregator() throws Exception {
.addAggregation(global("global").subAggregation(stats("value_stats").field("value")))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Global global = response.getAggregations().get("global");
assertThat(global, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java
index 3f47240fb0f9d..b92320c48ed1c 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/HistogramIT.java
@@ -51,7 +51,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.stats;
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -238,7 +238,7 @@ public void testSingleValuedField() throws Exception {
.addAggregation(histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -290,7 +290,7 @@ public void testSingleValuedFieldWithRandomOffset() throws Exception {
SearchResponse response = client().prepareSearch("idx")
.addAggregation(histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval).offset(offset))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
// shifting by offset>2 creates new extra bucket [0,offset-1]
// if offset is >= number of values in original last bucket, that effect is canceled
int expectedNumberOfBuckets = (offset >= (numDocs % interval + 1)) ? numValueBuckets : numValueBuckets + 1;
@@ -324,7 +324,7 @@ public void testSingleValuedFieldOrderedByKeyAsc() throws Exception {
.addAggregation(histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval).order(BucketOrder.key(true)))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -345,7 +345,7 @@ public void testsingleValuedFieldOrderedByKeyDesc() throws Exception {
.addAggregation(histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval).order(BucketOrder.key(false)))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -366,7 +366,7 @@ public void testSingleValuedFieldOrderedByCountAsc() throws Exception {
.addAggregation(histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval).order(BucketOrder.count(true)))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -393,7 +393,7 @@ public void testSingleValuedFieldOrderedByCountDesc() throws Exception {
.addAggregation(histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval).order(BucketOrder.count(false)))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -424,7 +424,7 @@ public void testSingleValuedFieldWithSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -467,7 +467,7 @@ public void testSingleValuedFieldOrderedBySubAggregationAsc() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -509,7 +509,7 @@ public void testSingleValuedFieldOrderedBySubAggregationDesc() throws Exception
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -551,7 +551,7 @@ public void testSingleValuedFieldOrderedByMultiValuedSubAggregationDesc() throws
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -595,7 +595,7 @@ public void testSingleValuedFieldOrderedBySubAggregationDescDeepOrderPath() thro
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -633,7 +633,7 @@ public void testSingleValuedFieldOrderedByTieBreaker() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -689,7 +689,7 @@ public void testSingleValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
final int numBuckets = (numDocs + 1) / interval - 2 / interval + 1;
final long[] counts = new long[(numDocs + 1) / interval + 1];
@@ -717,7 +717,7 @@ public void testMultiValuedField() throws Exception {
.addAggregation(histogram("histo").field(MULTI_VALUED_FIELD_NAME).interval(interval))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -738,7 +738,7 @@ public void testMultiValuedFieldOrderedByKeyDesc() throws Exception {
.addAggregation(histogram("histo").field(MULTI_VALUED_FIELD_NAME).interval(interval).order(BucketOrder.key(false)))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -763,7 +763,7 @@ public void testMultiValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
final int numBuckets = (numDocs + 2) / interval - 2 / interval + 1;
final long[] counts = new long[(numDocs + 2) / interval + 1];
@@ -799,7 +799,7 @@ public void testScriptSingleValue() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -823,7 +823,7 @@ public void testScriptMultiValued() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -844,7 +844,7 @@ public void testUnmapped() throws Exception {
.addAggregation(histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -857,7 +857,7 @@ public void testPartiallyUnmapped() throws Exception {
.addAggregation(histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -882,7 +882,7 @@ public void testPartiallyUnmappedWithExtendedBounds() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -990,7 +990,7 @@ public void testSingleValuedFieldWithExtendedBounds() throws Exception {
throw e;
}
}
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -1067,7 +1067,7 @@ public void testEmptyWithExtendedBounds() throws Exception {
throw e;
}
}
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -1110,7 +1110,7 @@ public void testDecimalIntervalAndOffset() throws Exception {
SearchResponse r = client().prepareSearch("decimal_values")
.addAggregation(histogram("histo").field("d").interval(0.7).offset(0.05))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
Histogram histogram = r.getAggregations().get("histo");
List extends Bucket> buckets = histogram.getBuckets();
@@ -1157,7 +1157,7 @@ public void testScriptCaching() throws Exception {
.offset(0.05)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1178,7 +1178,7 @@ public void testScriptCaching() throws Exception {
.offset(0.05)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1194,7 +1194,7 @@ public void testScriptCaching() throws Exception {
.setSize(0)
.addAggregation(histogram("histo").field("d").interval(0.7).offset(0.05))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1280,7 +1280,7 @@ public void testHardBounds() throws Exception {
SearchResponse r = client().prepareSearch("test")
.addAggregation(histogram("histo").field("d").interval(0.1).hardBounds(new DoubleBounds(0.0, null)))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
Histogram histogram = r.getAggregations().get("histo");
List extends Bucket> buckets = histogram.getBuckets();
@@ -1291,7 +1291,7 @@ public void testHardBounds() throws Exception {
r = client().prepareSearch("test")
.addAggregation(histogram("histo").field("d").interval(0.1).hardBounds(new DoubleBounds(null, 0.0)))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
histogram = r.getAggregations().get("histo");
buckets = histogram.getBuckets();
@@ -1301,7 +1301,7 @@ public void testHardBounds() throws Exception {
r = client().prepareSearch("test")
.addAggregation(histogram("histo").field("d").interval(0.1).hardBounds(new DoubleBounds(0.0, 0.3)))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
histogram = r.getAggregations().get("histo");
buckets = histogram.getBuckets();
@@ -1321,7 +1321,7 @@ private void assertMultiSortResponse(long[] expectedKeys, BucketOrder... order)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histogram = response.getAggregations().get("histo");
assertThat(histogram, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/IpRangeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/IpRangeIT.java
index 22cf163c44005..1768773ba7696 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/IpRangeIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/IpRangeIT.java
@@ -25,7 +25,7 @@
import java.util.function.Function;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.instanceOf;
@@ -73,7 +73,7 @@ public void testSingleValuedField() {
.addUnboundedFrom("192.168.1.10")
)
.get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
Range range = rsp.getAggregations().get("my_range");
assertEquals(3, range.getBuckets().size());
@@ -106,7 +106,7 @@ public void testMultiValuedField() {
.addUnboundedFrom("192.168.1.10")
)
.get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
Range range = rsp.getAggregations().get("my_range");
assertEquals(3, range.getBuckets().size());
@@ -139,7 +139,7 @@ public void testIpMask() {
.addMaskRange("2001:db8::/64")
)
.get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
Range range = rsp.getAggregations().get("my_range");
assertEquals(3, range.getBuckets().size());
@@ -166,7 +166,7 @@ public void testPartiallyUnmapped() {
.addUnboundedFrom("192.168.1.10")
)
.get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
Range range = rsp.getAggregations().get("my_range");
assertEquals(3, range.getBuckets().size());
@@ -199,7 +199,7 @@ public void testUnmapped() {
.addUnboundedFrom("192.168.1.10")
)
.get();
- assertSearchResponse(rsp);
+ assertNoFailures(rsp);
Range range = rsp.getAggregations().get("my_range");
assertEquals(3, range.getBuckets().size());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/IpTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/IpTermsIT.java
index 568f18b15ecec..51733d98fd80a 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/IpTermsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/IpTermsIT.java
@@ -22,7 +22,7 @@
import java.util.function.Function;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
public class IpTermsIT extends AbstractTermsTestCase {
@@ -64,7 +64,7 @@ public void testScriptValue() throws Exception {
SearchResponse response = client().prepareSearch("index")
.addAggregation(new TermsAggregationBuilder("my_terms").script(script).executionHint(randomExecutionHint()))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("my_terms");
assertEquals(2, terms.getBuckets().size());
@@ -92,7 +92,7 @@ public void testScriptValues() throws Exception {
SearchResponse response = client().prepareSearch("index")
.addAggregation(new TermsAggregationBuilder("my_terms").script(script).executionHint(randomExecutionHint()))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("my_terms");
assertEquals(2, terms.getBuckets().size());
@@ -120,7 +120,7 @@ public void testMissingValue() throws Exception {
.addAggregation(new TermsAggregationBuilder("my_terms").field("ip").missing("127.0.0.1").executionHint(randomExecutionHint()))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("my_terms");
assertEquals(2, terms.getBuckets().size());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/LongTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/LongTermsIT.java
index fa5a23ecb322f..d65a246aedc5d 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/LongTermsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/LongTermsIT.java
@@ -53,7 +53,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.stats;
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -268,7 +268,7 @@ private void runTestFieldWithPartitionedFiltering(String field) throws Exception
SearchResponse allResponse = client().prepareSearch("idx")
.addAggregation(new TermsAggregationBuilder("terms").field(field).collectMode(randomFrom(SubAggCollectionMode.values())))
.get();
- assertSearchResponse(allResponse);
+ assertNoFailures(allResponse);
LongTerms terms = allResponse.getAggregations().get("terms");
assertThat(terms, notNullValue());
assertThat(terms.getName(), equalTo("terms"));
@@ -285,7 +285,7 @@ private void runTestFieldWithPartitionedFiltering(String field) throws Exception
.collectMode(randomFrom(SubAggCollectionMode.values()))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
assertThat(terms.getName(), equalTo("terms"));
@@ -306,7 +306,7 @@ public void testSingleValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
// Scripts force the results to doubles
DoubleTerms terms = response.getAggregations().get("terms");
@@ -332,7 +332,7 @@ public void testMultiValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
// Scripts force the results to doubles
DoubleTerms terms = response.getAggregations().get("terms");
@@ -362,7 +362,7 @@ public void testMultiValuedFieldWithValueScriptNotUnique() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
// The script always converts long to double
DoubleTerms terms = response.getAggregations().get("terms");
@@ -410,7 +410,7 @@ public void testScriptSingleValue() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -443,7 +443,7 @@ public void testScriptMultiValued() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -470,7 +470,7 @@ public void testPartiallyUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -495,7 +495,7 @@ public void testPartiallyUnmappedWithFormat() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -527,7 +527,7 @@ public void testSingleValuedFieldOrderedBySingleValueSubAggregationAscWithTermsS
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -568,7 +568,7 @@ public void testSingleValuedFieldOrderedBySingleBucketSubAggregationAsc() throws
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms tags = response.getAggregations().get("num_tags");
assertThat(tags, notNullValue());
@@ -609,7 +609,7 @@ public void testSingleValuedFieldOrderedBySubAggregationAscMultiHierarchyLevels(
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms tags = response.getAggregations().get("tags");
assertThat(tags, notNullValue());
@@ -749,7 +749,7 @@ public void testSingleValuedFieldOrderedByMultiValueSubAggregationAsc() throws E
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -780,7 +780,7 @@ public void testSingleValuedFieldOrderedByMultiValueSubAggregationDesc() throws
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -811,7 +811,7 @@ public void testSingleValuedFieldOrderedByMultiValueExtendedStatsAsc() throws Ex
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -882,7 +882,7 @@ private void assertMultiSortResponse(long[] expectedKeys, BucketOrder... order)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -942,7 +942,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "Math.random()", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -961,7 +961,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "_value + 1", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -974,7 +974,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(new TermsAggregationBuilder("terms").field("d")).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NaNSortingIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NaNSortingIT.java
index 5deeeb40953b9..d015825d775d3 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NaNSortingIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NaNSortingIT.java
@@ -28,7 +28,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.core.IsNull.notNullValue;
@@ -154,7 +154,7 @@ public void testTerms(String fieldName) {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
final Terms terms = response.getAggregations().get("terms");
assertCorrectlySorted(terms, asc, agg);
}
@@ -183,7 +183,7 @@ public void testLongHistogram() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
final Histogram histo = response.getAggregations().get("histo");
assertCorrectlySorted(histo, asc, agg);
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NestedIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NestedIT.java
index 823b4f8404176..e9ec509e3b4c7 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NestedIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/NestedIT.java
@@ -48,7 +48,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -182,7 +181,7 @@ public void testSimple() throws Exception {
.addAggregation(nested("nested", "nested").subAggregation(stats("nested_value_stats").field("nested.value")))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
double min = Double.POSITIVE_INFINITY;
double max = Double.NEGATIVE_INFINITY;
@@ -231,7 +230,7 @@ public void testNestedWithSubTermsAgg() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
long docCount = 0;
long[] counts = new long[numParents + 6];
@@ -284,7 +283,7 @@ public void testNestedAsSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms values = response.getAggregations().get("top_values");
assertThat(values, notNullValue());
@@ -313,7 +312,7 @@ public void testNestNestedAggs() throws Exception {
)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Nested level1 = response.getAggregations().get("level1");
assertThat(level1, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/RangeIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/RangeIT.java
index 95f60df960ab8..b94ed2aed4486 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/RangeIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/RangeIT.java
@@ -40,7 +40,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
@@ -142,7 +142,7 @@ public void testRangeAsSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
assertThat(terms.getBuckets().size(), equalTo(numDocs + 1));
@@ -200,7 +200,7 @@ public void testSingleValueField() throws Exception {
.addAggregation(range("range").field(SINGLE_VALUED_FIELD_NAME).addUnboundedTo(3).addRange(3, 6).addUnboundedFrom(6))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -241,7 +241,7 @@ public void testSingleValueFieldWithFormat() throws Exception {
.addAggregation(range("range").field(SINGLE_VALUED_FIELD_NAME).addUnboundedTo(3).addRange(3, 6).addUnboundedFrom(6).format("#"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -284,7 +284,7 @@ public void testSingleValueFieldWithCustomKey() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -331,7 +331,7 @@ public void testSingleValuedFieldWithSubAggregation() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -403,7 +403,7 @@ public void testSingleValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -457,7 +457,7 @@ public void testMultiValuedField() throws Exception {
.addAggregation(range("range").field(MULTI_VALUED_FIELD_NAME).addUnboundedTo(3).addRange(3, 6).addUnboundedFrom(6))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -517,7 +517,7 @@ public void testMultiValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -581,7 +581,7 @@ public void testScriptSingleValue() throws Exception {
.addAggregation(range("range").script(script).addUnboundedTo(3).addRange(3, 6).addUnboundedFrom(6))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -622,7 +622,7 @@ public void testEmptyRange() throws Exception {
.addAggregation(range("range").field(MULTI_VALUED_FIELD_NAME).addUnboundedTo(-1).addUnboundedFrom(1000))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -672,7 +672,7 @@ public void testScriptMultiValued() throws Exception {
.addAggregation(range("range").script(script).addUnboundedTo(3).addRange(3, 6).addUnboundedFrom(6))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -730,7 +730,7 @@ public void testUnmapped() throws Exception {
.addAggregation(range("range").field(SINGLE_VALUED_FIELD_NAME).addUnboundedTo(3).addRange(3, 6).addUnboundedFrom(6))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -773,7 +773,7 @@ public void testPartiallyUnmapped() throws Exception {
.addAggregation(range("range").field(SINGLE_VALUED_FIELD_NAME).addUnboundedTo(3).addRange(3, 6).addUnboundedFrom(6))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -816,7 +816,7 @@ public void testOverlappingRanges() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -930,7 +930,7 @@ public void testScriptCaching() throws Exception {
.addRange(0, 10)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -950,7 +950,7 @@ public void testScriptCaching() throws Exception {
.addRange(0, 10)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -963,7 +963,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(range("foo").field("i").addRange(0, 10)).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -980,7 +980,7 @@ public void testFieldAlias() {
.addAggregation(range("range").field("route_length_miles").addUnboundedTo(50.0).addRange(50.0, 150.0).addUnboundedFrom(150.0))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -1011,7 +1011,7 @@ public void testFieldAliasWithMissingValue() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java
index 5a8c560ad98f0..d40afeb433e38 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ReverseNestedIT.java
@@ -35,7 +35,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
@@ -157,7 +156,7 @@ public void testSimpleReverseNestedToRoot() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Nested nested = response.getAggregations().get("nested1");
assertThat(nested, notNullValue());
@@ -339,7 +338,7 @@ public void testSimpleNested1ToRootToNested2() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Nested nested = response.getAggregations().get("nested1");
assertThat(nested.getName(), equalTo("nested1"));
assertThat(nested.getDocCount(), equalTo(9L));
@@ -371,7 +370,7 @@ public void testSimpleReverseNestedToNested1() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Nested nested = response.getAggregations().get("nested1");
assertThat(nested, notNullValue());
@@ -714,7 +713,7 @@ public void testFieldAlias() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Nested nested = response.getAggregations().get("nested1");
Terms nestedTerms = nested.getAggregations().get("field2");
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SamplerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SamplerIT.java
index a9604ce1c62f3..e7f1f30fd8ad3 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SamplerIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SamplerIT.java
@@ -26,7 +26,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.sampler;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
@@ -99,7 +99,7 @@ public void testIssue10719() throws Exception {
.subAggregation(sampler("sample").shardSize(100).subAggregation(max("max_price").field("price")))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms genres = response.getAggregations().get("genres");
List extends Bucket> genreBuckets = genres.getBuckets();
// For this test to be useful we need >1 genre bucket to compare
@@ -129,7 +129,7 @@ public void testSimpleSampler() throws Exception {
.setSize(60)
.addAggregation(sampleAgg)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Sampler sample = response.getAggregations().get("sample");
Terms authors = sample.getAggregations().get("authors");
List extends Bucket> testBuckets = authors.getBuckets();
@@ -151,7 +151,7 @@ public void testUnmappedChildAggNoDiversity() throws Exception {
.setSize(60)
.addAggregation(sampleAgg)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Sampler sample = response.getAggregations().get("sample");
assertThat(sample.getDocCount(), equalTo(0L));
Terms authors = sample.getAggregations().get("authors");
@@ -169,7 +169,7 @@ public void testPartiallyUnmappedChildAggNoDiversity() throws Exception {
.setExplain(true)
.addAggregation(sampleAgg)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Sampler sample = response.getAggregations().get("sample");
assertThat(sample.getDocCount(), greaterThan(0L));
Terms authors = sample.getAggregations().get("authors");
@@ -186,6 +186,6 @@ public void testRidiculousShardSizeSampler() throws Exception {
.setSize(60)
.addAggregation(sampleAgg)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
}
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ShardReduceIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ShardReduceIT.java
index 1dba19319efc2..63f31d2fbb972 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ShardReduceIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/ShardReduceIT.java
@@ -36,7 +36,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.range;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
@@ -96,7 +96,7 @@ public void testGlobal() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Global global = response.getAggregations().get("global");
Histogram histo = global.getAggregations().get("histo");
@@ -113,7 +113,7 @@ public void testFilter() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Filter filter = response.getAggregations().get("filter");
Histogram histo = filter.getAggregations().get("histo");
@@ -129,7 +129,7 @@ public void testMissing() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Missing missing = response.getAggregations().get("missing");
Histogram histo = missing.getAggregations().get("histo");
@@ -149,7 +149,7 @@ public void testGlobalWithFilterWithMissing() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Global global = response.getAggregations().get("global");
Filter filter = global.getAggregations().get("filter");
@@ -168,7 +168,7 @@ public void testNested() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Nested nested = response.getAggregations().get("nested");
Histogram histo = nested.getAggregations().get("histo");
@@ -185,7 +185,7 @@ public void testStringTerms() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
Histogram histo = terms.getBucketByKey("term").getAggregations().get("histo");
@@ -202,7 +202,7 @@ public void testLongTerms() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
Histogram histo = terms.getBucketByKey("1").getAggregations().get("histo");
@@ -219,7 +219,7 @@ public void testDoubleTerms() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
Histogram histo = terms.getBucketByKey("1.5").getAggregations().get("histo");
@@ -236,7 +236,7 @@ public void testRange() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
Histogram histo = range.getBuckets().get(0).getAggregations().get("histo");
@@ -253,7 +253,7 @@ public void testDateRange() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
Histogram histo = range.getBuckets().get(0).getAggregations().get("histo");
@@ -270,7 +270,7 @@ public void testIpRange() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
Histogram histo = range.getBuckets().get(0).getAggregations().get("histo");
@@ -287,7 +287,7 @@ public void testHistogram() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram topHisto = response.getAggregations().get("topHisto");
Histogram histo = topHisto.getBuckets().get(0).getAggregations().get("histo");
@@ -304,7 +304,7 @@ public void testDateHistogram() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram topHisto = response.getAggregations().get("topHisto");
Histogram histo = topHisto.getBuckets().iterator().next().getAggregations().get("histo");
@@ -321,7 +321,7 @@ public void testGeoHashGrid() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoGrid grid = response.getAggregations().get("grid");
Histogram histo = grid.getBuckets().iterator().next().getAggregations().get("histo");
@@ -337,7 +337,7 @@ public void testGeoTileGrid() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoGrid grid = response.getAggregations().get("grid");
Histogram histo = grid.getBuckets().iterator().next().getAggregations().get("histo");
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SignificantTermsSignificanceScoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SignificantTermsSignificanceScoreIT.java
index c8d89785fc4af..1932e640e785e 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SignificantTermsSignificanceScoreIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/SignificantTermsSignificanceScoreIT.java
@@ -57,7 +57,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.significantText;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
@@ -130,7 +130,7 @@ public void testXContentResponse() throws Exception {
SearchResponse response = request.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms classes = response.getAggregations().get("class");
assertThat(classes.getBuckets().size(), equalTo(2));
for (Terms.Bucket classBucket : classes.getBuckets()) {
@@ -287,7 +287,7 @@ public void testBackgroundVsSeparateSet(
}
SearchResponse response1 = request1.get();
- assertSearchResponse(response1);
+ assertNoFailures(response1);
SearchRequestBuilder request2;
if (useSigText) {
@@ -390,9 +390,9 @@ public void testScoresEqualForPositiveAndNegative(SignificanceHeuristic heuristi
);
}
SearchResponse response = request.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms classes = response.getAggregations().get("class");
assertThat(classes.getBuckets().size(), equalTo(2));
Iterator extends Terms.Bucket> classBuckets = classes.getBuckets().iterator();
@@ -428,7 +428,7 @@ public void testSubAggregations() throws Exception {
.subAggregation(subAgg);
SearchResponse response = client().prepareSearch("test").setQuery(query).addAggregation(agg).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SignificantTerms sigTerms = response.getAggregations().get("significant_terms");
assertThat(sigTerms.getBuckets().size(), equalTo(2));
@@ -504,7 +504,7 @@ public void testScriptScore() throws ExecutionException, InterruptedException, I
);
}
SearchResponse response = request.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
for (Terms.Bucket classBucket : ((Terms) response.getAggregations().get("class")).getBuckets()) {
SignificantTerms sigTerms = classBucket.getAggregations().get("mySignificantTerms");
for (SignificantTerms.Bucket bucket : sigTerms.getBuckets()) {
@@ -598,7 +598,7 @@ public void testScriptCaching() throws Exception {
.addAggregation(significantTerms("foo").field("s").significanceHeuristic(scriptHeuristic))
.get();
}
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -623,7 +623,7 @@ public void testScriptCaching() throws Exception {
.addAggregation(significantTerms("foo").field("s").significanceHeuristic(scriptHeuristic))
.get();
}
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -640,7 +640,7 @@ public void testScriptCaching() throws Exception {
} else {
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(significantTerms("foo").field("s")).get();
}
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsDocCountErrorIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsDocCountErrorIT.java
index 46c2c693132cc..d010962385232 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsDocCountErrorIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsDocCountErrorIT.java
@@ -28,7 +28,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;
@@ -278,7 +278,7 @@ public void testStringValueField() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx")
.addAggregation(
@@ -291,7 +291,7 @@ public void testStringValueField() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertDocCountErrorWithinBounds(size, accurateResponse, testResponse);
}
@@ -310,7 +310,7 @@ public void testStringValueFieldSingleShard() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -323,7 +323,7 @@ public void testStringValueFieldSingleShard() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountError(size, accurateResponse, testResponse);
}
@@ -344,7 +344,7 @@ public void testStringValueFieldWithRouting() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountErrorSingleResponse(size, testResponse);
}
@@ -364,7 +364,7 @@ public void testStringValueFieldDocCountAsc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -378,7 +378,7 @@ public void testStringValueFieldDocCountAsc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertUnboundedDocCountError(size, accurateResponse, testResponse);
}
@@ -398,7 +398,7 @@ public void testStringValueFieldTermSortAsc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -412,7 +412,7 @@ public void testStringValueFieldTermSortAsc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountError(size, accurateResponse, testResponse);
}
@@ -432,7 +432,7 @@ public void testStringValueFieldTermSortDesc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -446,7 +446,7 @@ public void testStringValueFieldTermSortDesc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountError(size, accurateResponse, testResponse);
}
@@ -467,7 +467,7 @@ public void testStringValueFieldSubAggAsc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -482,7 +482,7 @@ public void testStringValueFieldSubAggAsc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertUnboundedDocCountError(size, accurateResponse, testResponse);
}
@@ -503,7 +503,7 @@ public void testStringValueFieldSubAggDesc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -518,7 +518,7 @@ public void testStringValueFieldSubAggDesc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertUnboundedDocCountError(size, accurateResponse, testResponse);
}
@@ -537,7 +537,7 @@ public void testLongValueField() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx")
.addAggregation(
@@ -550,7 +550,7 @@ public void testLongValueField() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertDocCountErrorWithinBounds(size, accurateResponse, testResponse);
}
@@ -569,7 +569,7 @@ public void testLongValueFieldSingleShard() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -582,7 +582,7 @@ public void testLongValueFieldSingleShard() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountError(size, accurateResponse, testResponse);
}
@@ -603,7 +603,7 @@ public void testLongValueFieldWithRouting() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountErrorSingleResponse(size, testResponse);
}
@@ -623,7 +623,7 @@ public void testLongValueFieldDocCountAsc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -637,7 +637,7 @@ public void testLongValueFieldDocCountAsc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertUnboundedDocCountError(size, accurateResponse, testResponse);
}
@@ -657,7 +657,7 @@ public void testLongValueFieldTermSortAsc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -671,7 +671,7 @@ public void testLongValueFieldTermSortAsc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountError(size, accurateResponse, testResponse);
}
@@ -691,7 +691,7 @@ public void testLongValueFieldTermSortDesc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -705,7 +705,7 @@ public void testLongValueFieldTermSortDesc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountError(size, accurateResponse, testResponse);
}
@@ -726,7 +726,7 @@ public void testLongValueFieldSubAggAsc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -741,7 +741,7 @@ public void testLongValueFieldSubAggAsc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertUnboundedDocCountError(size, accurateResponse, testResponse);
}
@@ -762,7 +762,7 @@ public void testLongValueFieldSubAggDesc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -777,7 +777,7 @@ public void testLongValueFieldSubAggDesc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertUnboundedDocCountError(size, accurateResponse, testResponse);
}
@@ -796,7 +796,7 @@ public void testDoubleValueField() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx")
.addAggregation(
@@ -809,7 +809,7 @@ public void testDoubleValueField() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertDocCountErrorWithinBounds(size, accurateResponse, testResponse);
}
@@ -828,7 +828,7 @@ public void testDoubleValueFieldSingleShard() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -841,7 +841,7 @@ public void testDoubleValueFieldSingleShard() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountError(size, accurateResponse, testResponse);
}
@@ -862,7 +862,7 @@ public void testDoubleValueFieldWithRouting() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountErrorSingleResponse(size, testResponse);
}
@@ -882,7 +882,7 @@ public void testDoubleValueFieldDocCountAsc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -896,7 +896,7 @@ public void testDoubleValueFieldDocCountAsc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertUnboundedDocCountError(size, accurateResponse, testResponse);
}
@@ -916,7 +916,7 @@ public void testDoubleValueFieldTermSortAsc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -930,7 +930,7 @@ public void testDoubleValueFieldTermSortAsc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountError(size, accurateResponse, testResponse);
}
@@ -950,7 +950,7 @@ public void testDoubleValueFieldTermSortDesc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -964,7 +964,7 @@ public void testDoubleValueFieldTermSortDesc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertNoDocCountError(size, accurateResponse, testResponse);
}
@@ -985,7 +985,7 @@ public void testDoubleValueFieldSubAggAsc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -1000,7 +1000,7 @@ public void testDoubleValueFieldSubAggAsc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertUnboundedDocCountError(size, accurateResponse, testResponse);
}
@@ -1021,7 +1021,7 @@ public void testDoubleValueFieldSubAggDesc() throws Exception {
)
.get();
- assertSearchResponse(accurateResponse);
+ assertNoFailures(accurateResponse);
SearchResponse testResponse = client().prepareSearch("idx_single_shard")
.addAggregation(
@@ -1036,7 +1036,7 @@ public void testDoubleValueFieldSubAggDesc() throws Exception {
)
.get();
- assertSearchResponse(testResponse);
+ assertNoFailures(testResponse);
assertUnboundedDocCountError(size, accurateResponse, testResponse);
}
@@ -1057,7 +1057,7 @@ public void testFixedDocs() throws Exception {
.collectMode(randomFrom(SubAggCollectionMode.values()))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -1112,7 +1112,7 @@ public void testIncrementalReduction() {
.collectMode(randomFrom(SubAggCollectionMode.values()))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms.getDocCountError(), equalTo(0L));
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsShardMinDocCountIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsShardMinDocCountIT.java
index 85cc185d1f558..9b8da69a13e1e 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsShardMinDocCountIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/TermsShardMinDocCountIT.java
@@ -25,7 +25,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.significantTerms;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
public class TermsShardMinDocCountIT extends ESIntegTestCase {
@@ -72,7 +72,7 @@ public void testShardMinDocCountSignificantTermsTest() throws Exception {
)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
InternalFilter filteredBucket = response.getAggregations().get("inclass");
SignificantTerms sigterms = filteredBucket.getAggregations().get("mySignificantTerms");
assertThat(sigterms.getBuckets().size(), equalTo(0));
@@ -89,7 +89,7 @@ public void testShardMinDocCountSignificantTermsTest() throws Exception {
)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
filteredBucket = response.getAggregations().get("inclass");
sigterms = filteredBucket.getAggregations().get("mySignificantTerms");
assertThat(sigterms.getBuckets().size(), equalTo(2));
@@ -136,7 +136,7 @@ public void testShardMinDocCountTermsTest() throws Exception {
.order(BucketOrder.key(true))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms sigterms = response.getAggregations().get("myTerms");
assertThat(sigterms.getBuckets().size(), equalTo(0));
@@ -151,7 +151,7 @@ public void testShardMinDocCountTermsTest() throws Exception {
.order(BucketOrder.key(true))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
sigterms = response.getAggregations().get("myTerms");
assertThat(sigterms.getBuckets().size(), equalTo(2));
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java
index 60af5cfad0004..de458c1e2bb76 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/bucket/terms/StringTermsIT.java
@@ -58,7 +58,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.stats;
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -305,7 +305,7 @@ private void runTestFieldWithPartitionedFiltering(String field) throws Exception
new TermsAggregationBuilder("terms").field(field).size(10000).collectMode(randomFrom(SubAggCollectionMode.values()))
)
.get();
- assertSearchResponse(allResponse);
+ assertNoFailures(allResponse);
StringTerms terms = allResponse.getAggregations().get("terms");
assertThat(terms, notNullValue());
assertThat(terms.getName(), equalTo("terms"));
@@ -322,7 +322,7 @@ private void runTestFieldWithPartitionedFiltering(String field) throws Exception
.collectMode(randomFrom(SubAggCollectionMode.values()))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
assertThat(terms.getName(), equalTo("terms"));
@@ -343,7 +343,7 @@ public void testSingleValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -368,7 +368,7 @@ public void testMultiValuedFieldWithValueScriptNotUnique() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -397,7 +397,7 @@ public void testMultiValuedScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -426,7 +426,7 @@ public void testMultiValuedFieldWithValueScript() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -473,7 +473,7 @@ public void testScriptSingleValue() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -504,7 +504,7 @@ public void testScriptSingleValueExplicitSingleValue() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -536,7 +536,7 @@ public void testScriptMultiValued() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -564,7 +564,7 @@ public void testPartiallyUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -655,7 +655,7 @@ public void testSingleValuedFieldOrderedBySingleBucketSubAggregationAsc() throws
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms tags = response.getAggregations().get("tags");
assertThat(tags, notNullValue());
@@ -697,7 +697,7 @@ public void testSingleValuedFieldOrderedBySubAggregationAscMultiHierarchyLevels(
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms tags = response.getAggregations().get("tags");
assertThat(tags, notNullValue());
@@ -760,7 +760,7 @@ public void testSingleValuedFieldOrderedBySubAggregationAscMultiHierarchyLevelsS
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms tags = response.getAggregations().get("tags");
assertThat(tags, notNullValue());
@@ -823,7 +823,7 @@ public void testSingleValuedFieldOrderedBySubAggregationAscMultiHierarchyLevelsS
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms tags = response.getAggregations().get("tags");
assertThat(tags, notNullValue());
@@ -972,7 +972,7 @@ public void testSingleValuedFieldOrderedByMultiValueSubAggregationAsc() throws E
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -1004,7 +1004,7 @@ public void testSingleValuedFieldOrderedByMultiValueSubAggregationDesc() throws
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -1037,7 +1037,7 @@ public void testSingleValuedFieldOrderedByMultiValueExtendedStatsAsc() throws Ex
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -1073,7 +1073,7 @@ public void testSingleValuedFieldOrderedByStatsAggAscWithTermsSubAgg() throws Ex
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -1157,7 +1157,7 @@ private void assertMultiSortResponse(String[] expectedKeys, BucketOrder... order
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -1188,7 +1188,7 @@ public void testIndexMetaField() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
assertThat(terms.getName(), equalTo("terms"));
@@ -1241,7 +1241,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "Math.random()", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1260,7 +1260,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "'foo_' + _value", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1273,7 +1273,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(new TermsAggregationBuilder("terms").field("d")).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1297,7 +1297,7 @@ public void testScriptWithValueType() throws Exception {
try (XContentParser parser = createParser(JsonXContent.jsonXContent, source)) {
SearchResponse response = client().prepareSearch("idx").setSource(new SearchSourceBuilder().parseXContent(parser, true)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
LongTerms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
assertThat(terms.getName(), equalTo("terms"));
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsIT.java
index 51d0d5411d6f7..9a8eb1e7b45cd 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ExtendedStatsIT.java
@@ -38,7 +38,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
@@ -873,7 +873,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "Math.random()", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -892,7 +892,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "_value + 1", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -905,7 +905,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(extendedStats("foo").field("d")).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsIT.java
index 12bb521358642..2fef88b7610db 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/GeoBoundsIT.java
@@ -14,7 +14,7 @@
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.geo.RandomGeoGenerator;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.equalTo;
@@ -30,7 +30,7 @@ public void testSingleValuedFieldNearDateLine() {
.addAggregation(boundsAgg(aggName(), SINGLE_VALUED_FIELD_NAME).wrapLongitude(false))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoPoint geoValuesTopLeft = new GeoPoint(38, -179);
GeoPoint geoValuesBottomRight = new GeoPoint(-24, 178);
@@ -54,7 +54,7 @@ public void testSingleValuedFieldNearDateLineWrapLongitude() {
.addAggregation(boundsAgg(aggName(), SINGLE_VALUED_FIELD_NAME).wrapLongitude(true))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoBounds geoBounds = response.getAggregations().get(aggName());
assertThat(geoBounds, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidIT.java
index d1caf6d5cb80a..d1ae1589a5c2a 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/GeoCentroidIT.java
@@ -18,7 +18,7 @@
import java.util.List;
import static org.elasticsearch.search.aggregations.AggregationBuilders.geohashGrid;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue;
@@ -35,7 +35,7 @@ public void testSingleValueFieldAsSubAggToGeohashGrid() {
.subAggregation(centroidAgg(aggName()).field(SINGLE_VALUED_FIELD_NAME))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
GeoGrid grid = response.getAggregations().get("geoGrid");
assertThat(grid, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/HDRPercentileRanksIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/HDRPercentileRanksIT.java
index 0bdd75f73e743..59393da57666e 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/HDRPercentileRanksIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/HDRPercentileRanksIT.java
@@ -39,7 +39,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
@@ -584,7 +584,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "Math.random()", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -604,7 +604,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "_value - 1", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -620,7 +620,7 @@ public void testScriptCaching() throws Exception {
.setSize(0)
.addAggregation(percentileRanks("foo", new double[] { 50.0 }).method(PercentilesMethod.HDR).field("d"))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/HDRPercentilesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/HDRPercentilesIT.java
index 58a22a32ae13b..19a1ce91fc4c8 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/HDRPercentilesIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/HDRPercentilesIT.java
@@ -41,7 +41,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
@@ -554,7 +554,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "Math.random()", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -575,7 +575,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "_value - 1", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -591,7 +591,7 @@ public void testScriptCaching() throws Exception {
.setSize(0)
.addAggregation(percentiles("foo").method(PercentilesMethod.HDR).field("d").percentiles(50.0))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationIT.java
index b9eacda5d3750..844b77334f70a 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/MedianAbsoluteDeviationIT.java
@@ -45,7 +45,7 @@
import static org.elasticsearch.search.aggregations.metrics.MedianAbsoluteDeviationAggregatorTests.IsCloseToRelative.closeToRelative;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
@@ -517,7 +517,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "Math.random()", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -536,7 +536,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "_value - 1", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -549,7 +549,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(randomBuilder().field("d")).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricIT.java
index a144acf809b53..41dd285e900f4 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ScriptedMetricIT.java
@@ -49,7 +49,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.histogram;
import static org.elasticsearch.search.aggregations.AggregationBuilders.scriptedMetric;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsString;
@@ -363,7 +363,7 @@ public void testMap() {
.setQuery(matchAllQuery())
.addAggregation(scriptedMetric("scripted").mapScript(mapScript).combineScript(combineScript).reduceScript(reduceScript))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -411,7 +411,7 @@ public void testMapWithParams() {
.reduceScript(reduceScript)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -463,7 +463,7 @@ public void testInitMutatesParams() {
.reduceScript(new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "no-op list aggregation", Collections.emptyMap()))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -517,7 +517,7 @@ public void testMapCombineWithParams() {
scriptedMetric("scripted").params(params).mapScript(mapScript).combineScript(combineScript).reduceScript(reduceScript)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -580,7 +580,7 @@ public void testInitMapCombineWithParams() {
.reduceScript(reduceScript)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -648,7 +648,7 @@ public void testInitMapCombineReduceWithParams() {
.reduceScript(reduceScript)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -707,7 +707,7 @@ public void testInitMapCombineReduceGetProperty() throws Exception {
)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(numDocs));
Global global = searchResponse.getAggregations().get("global");
@@ -765,7 +765,7 @@ public void testMapCombineReduceWithParams() {
scriptedMetric("scripted").params(params).mapScript(mapScript).combineScript(combineScript).reduceScript(reduceScript)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -815,7 +815,7 @@ public void testInitMapReduceWithParams() {
.reduceScript(reduceScript)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -859,7 +859,7 @@ public void testMapReduceWithParams() {
scriptedMetric("scripted").params(params).mapScript(mapScript).combineScript(combineScript).reduceScript(reduceScript)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -917,7 +917,7 @@ public void testInitMapCombineReduceWithParamsAndReduceParams() {
.reduceScript(reduceScript)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -952,7 +952,7 @@ public void testInitMapCombineReduceWithParamsStored() {
.reduceScript(new Script(ScriptType.STORED, null, "reduceScript_stored", Collections.emptyMap()))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("scripted");
@@ -1012,7 +1012,7 @@ public void testInitMapCombineReduceWithParamsAsSubAgg() {
)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(numDocs));
Aggregation aggregation = response.getAggregations().get("histo");
assertThat(aggregation, notNullValue());
@@ -1150,7 +1150,7 @@ public void testScriptCaching() throws Exception {
scriptedMetric("foo").initScript(ndInitScript).mapScript(mapScript).combineScript(combineScript).reduceScript(reduceScript)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1166,7 +1166,7 @@ public void testScriptCaching() throws Exception {
.setSize(0)
.addAggregation(scriptedMetric("foo").mapScript(ndMapScript).combineScript(combineScript).reduceScript(reduceScript))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1182,7 +1182,7 @@ public void testScriptCaching() throws Exception {
.setSize(0)
.addAggregation(scriptedMetric("foo").mapScript(mapScript).combineScript(ndRandom).reduceScript(reduceScript))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1198,7 +1198,7 @@ public void testScriptCaching() throws Exception {
.setSize(0)
.addAggregation(scriptedMetric("foo").mapScript(mapScript).combineScript(combineScript).reduceScript(ndRandom))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1214,7 +1214,7 @@ public void testScriptCaching() throws Exception {
.setSize(0)
.addAggregation(scriptedMetric("foo").mapScript(mapScript).combineScript(combineScript).reduceScript(reduceScript))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/StatsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/StatsIT.java
index 06149028e3fb5..1b1bba3fc2529 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/StatsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/StatsIT.java
@@ -34,7 +34,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
@@ -261,7 +261,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "Math.random()", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -280,7 +280,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "_value + 1", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -293,7 +293,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(stats("foo").field("d")).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/SumIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/SumIT.java
index 75e2870c58ff5..9ea866f889720 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/SumIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/SumIT.java
@@ -38,7 +38,7 @@
import static org.elasticsearch.search.aggregations.metrics.MetricAggScriptPlugin.VALUE_SCRIPT;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue;
@@ -238,7 +238,7 @@ public void testScriptCaching() throws Exception {
sum("foo").field("d").script(new Script(ScriptType.INLINE, METRIC_SCRIPT_ENGINE, RANDOM_SCRIPT, Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -256,7 +256,7 @@ public void testScriptCaching() throws Exception {
sum("foo").field("d").script(new Script(ScriptType.INLINE, METRIC_SCRIPT_ENGINE, VALUE_SCRIPT, Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -269,7 +269,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(sum("foo").field("d")).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -286,7 +286,7 @@ public void testFieldAlias() {
.addAggregation(sum("sum").field("route_length_miles"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Sum sum = response.getAggregations().get("sum");
assertThat(sum, IsNull.notNullValue());
@@ -299,7 +299,7 @@ public void testFieldAliasInSubAggregation() {
.addAggregation(terms("terms").field("transit_mode").subAggregation(sum("sum").field("route_length_miles")))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TDigestPercentileRanksIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TDigestPercentileRanksIT.java
index 6909bd719f6dd..8a1ee38630be9 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TDigestPercentileRanksIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TDigestPercentileRanksIT.java
@@ -39,7 +39,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
@@ -495,7 +495,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "Math.random()", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -514,7 +514,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "_value - 1", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -530,7 +530,7 @@ public void testScriptCaching() throws Exception {
.setSize(0)
.addAggregation(percentileRanks("foo", new double[] { 50.0 }).field("d"))
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TDigestPercentilesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TDigestPercentilesIT.java
index 3fc5bf9863256..5a2f246735a32 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TDigestPercentilesIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TDigestPercentilesIT.java
@@ -41,7 +41,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
import static org.hamcrest.Matchers.lessThanOrEqualTo;
@@ -468,7 +468,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "Math.random()", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -488,7 +488,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, AggregationTestScriptsPlugin.NAME, "_value - 1", emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -501,7 +501,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(percentiles("foo").field("d").percentiles(50.0)).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TopHitsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TopHitsIT.java
index 5829f75d45edb..685e269516b0f 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TopHitsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/TopHitsIT.java
@@ -65,7 +65,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.xcontent.XContentFactory.smileBuilder;
import static org.elasticsearch.xcontent.XContentFactory.yamlBuilder;
@@ -320,7 +319,7 @@ public void testBasics() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -354,7 +353,7 @@ public void testIssue11119() throws Exception {
.addAggregation(terms("terms").executionHint(randomExecutionHint()).field("group").subAggregation(topHits("hits")))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(8L));
assertThat(response.getHits().getHits().length, equalTo(0));
@@ -388,7 +387,7 @@ public void testIssue11119() throws Exception {
.addAggregation(terms("terms").executionHint(randomExecutionHint()).field("group"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(8L));
assertThat(response.getHits().getHits().length, equalTo(0));
@@ -409,7 +408,7 @@ public void testBreadthFirstWithScoreNeeded() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -442,7 +441,7 @@ public void testBreadthFirstWithAggOrderAndScoreNeeded() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -469,7 +468,7 @@ public void testBasicsGetProperty() throws Exception {
.addAggregation(global("global").subAggregation(topHits("hits")))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Global global = searchResponse.getAggregations().get("global");
assertThat(global, notNullValue());
@@ -494,7 +493,7 @@ public void testPagination() throws Exception {
.subAggregation(topHits("hits").sort(SortBuilders.fieldSort(SORT_FIELD).order(SortOrder.DESC)).from(from).size(size))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SearchResponse control = client().prepareSearch("idx")
.setFrom(from)
@@ -502,7 +501,7 @@ public void testPagination() throws Exception {
.setPostFilter(QueryBuilders.termQuery(TERMS_AGGS_FIELD, "val0"))
.addSort(SORT_FIELD, SortOrder.DESC)
.get();
- assertSearchResponse(control);
+ assertNoFailures(control);
SearchHits controlHits = control.getHits();
Terms terms = response.getAggregations().get("terms");
@@ -541,7 +540,7 @@ public void testSortByBucket() throws Exception {
.subAggregation(max("max_sort").field(SORT_FIELD))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -578,7 +577,7 @@ public void testFieldCollapsing() throws Exception {
.subAggregation(max("max_score").field("value"))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -632,7 +631,7 @@ public void testFetchFeatures() {
)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -699,7 +698,7 @@ public void testInvalidSortField() throws Exception {
public void testEmptyIndex() throws Exception {
SearchResponse response = client().prepareSearch("empty").addAggregation(topHits("hits")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
TopHits hits = response.getAggregations().get("hits");
assertThat(hits, notNullValue());
@@ -718,7 +717,7 @@ public void testTrackScores() throws Exception {
.subAggregation(topHits("hits").trackScores(trackScore).size(1).sort("_index", SortOrder.DESC))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -1077,7 +1076,7 @@ public void testNoStoredFields() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -1139,7 +1138,7 @@ public void testScriptCaching() throws Exception {
)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1162,7 +1161,7 @@ public void testScriptCaching() throws Exception {
)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1180,7 +1179,7 @@ public void testScriptCaching() throws Exception {
topHits("foo").scriptField("bar", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "5", Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1203,7 +1202,7 @@ public void testScriptCaching() throws Exception {
)
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -1216,7 +1215,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(topHits("foo")).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ValueCountIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ValueCountIT.java
index dda06b9f422ad..62f28211c674a 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ValueCountIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/metrics/ValueCountIT.java
@@ -37,7 +37,7 @@
import static org.elasticsearch.search.aggregations.metrics.MetricAggScriptPlugin.VALUE_FIELD_SCRIPT;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue;
@@ -241,7 +241,7 @@ public void testScriptCaching() throws Exception {
count("foo").field("d").script(new Script(ScriptType.INLINE, METRIC_SCRIPT_ENGINE, RANDOM_SCRIPT, Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -260,7 +260,7 @@ public void testScriptCaching() throws Exception {
.script(new Script(ScriptType.INLINE, METRIC_SCRIPT_ENGINE, VALUE_FIELD_SCRIPT, Collections.emptyMap()))
)
.get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
@@ -273,7 +273,7 @@ public void testScriptCaching() throws Exception {
// Ensure that non-scripted requests are cached as normal
r = client().prepareSearch("cache_test_idx").setSize(0).addAggregation(count("foo").field("d")).get();
- assertSearchResponse(r);
+ assertNoFailures(r);
assertThat(
indicesAdmin().prepareStats("cache_test_idx").setRequestCache(true).get().getTotal().getRequestCache().getHitCount(),
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipeLineAggregationTestCase.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipeLineAggregationTestCase.java
index cc4cfabfffa54..4947f9a3a43e0 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipeLineAggregationTestCase.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketMetricsPipeLineAggregationTestCase.java
@@ -37,7 +37,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
@@ -134,7 +134,7 @@ public void testDocCountTopLevel() {
.addAggregation(BucketMetricsPipelineAgg("pipeline_agg", histoName + ">_count"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get(histoName);
assertThat(histo, notNullValue());
@@ -170,7 +170,7 @@ public void testDocCountAsSubAgg() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get(termsName);
assertThat(terms, notNullValue());
@@ -208,7 +208,7 @@ public void testMetricTopLevel() {
.addAggregation(BucketMetricsPipelineAgg("pipeline_agg", termsName + ">sum"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get(termsName);
assertThat(terms, notNullValue());
@@ -250,7 +250,7 @@ public void testMetricAsSubAgg() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get(termsName);
assertThat(terms, notNullValue());
@@ -308,7 +308,7 @@ public void testMetricAsSubAggWithInsertZeros() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get(termsName);
assertThat(terms, notNullValue());
@@ -355,7 +355,7 @@ public void testNoBuckets() {
.addAggregation(BucketMetricsPipelineAgg("pipeline_agg", termsName + ">sum"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get(termsName);
assertThat(terms, notNullValue());
@@ -385,7 +385,7 @@ public void testNested() {
.addAggregation(BucketMetricsPipelineAgg("nested_terms_bucket", termsName + ">nested_histo_bucket." + nestedMetric()))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get(termsName);
assertThat(terms, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptIT.java
index 5c4caf5f242a6..56101a7c7a4ce 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/BucketScriptIT.java
@@ -42,7 +42,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.bucketScript;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue;
@@ -174,7 +174,7 @@ public void testInlineScript() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -224,7 +224,7 @@ public void testInlineScript2() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -274,7 +274,7 @@ public void testInlineScriptWithDateRange() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("range");
assertThat(range, notNullValue());
@@ -320,7 +320,7 @@ public void testInlineScriptSingleVariable() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -366,7 +366,7 @@ public void testInlineScriptNamedVars() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -413,7 +413,7 @@ public void testInlineScriptWithParams() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -463,7 +463,7 @@ public void testInlineScriptInsertZeros() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -509,7 +509,7 @@ public void testInlineScriptReturnNull() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -552,7 +552,7 @@ public void testStoredScript() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -602,7 +602,7 @@ public void testUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram deriv = response.getAggregations().get("histo");
assertThat(deriv, notNullValue());
@@ -630,7 +630,7 @@ public void testPartiallyUnmapped() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -683,7 +683,7 @@ public void testSingleBucketPathAgg() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -732,7 +732,7 @@ public void testArrayBucketPathAgg() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -791,7 +791,7 @@ public void testObjectBucketPathAgg() throws Exception {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -885,7 +885,7 @@ public void testInlineScriptWithMultiValueAggregation() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
@@ -940,7 +940,7 @@ public void testInlineScriptWithMultiValueAggregationDifferentBucketsPaths() {
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketIT.java
index 2950276e5c552..87731e40b9a90 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/ExtendedStatsBucketIT.java
@@ -26,7 +26,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.extendedStatsBucket;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.core.IsNull.notNullValue;
@@ -104,7 +104,7 @@ public void testGappyIndexWithSigma() {
.addAggregation(histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(1L))
.addAggregation(extendedStatsBucket("extended_stats_bucket", "histo>_count").sigma(sigma))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
assertThat(histo.getName(), equalTo("histo"));
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java
index 53ebbfc0bb016..ab9987f7d1255 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/aggregations/pipeline/PercentilesBucketIT.java
@@ -28,7 +28,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.search.aggregations.PipelineAggregatorBuilders.percentilesBucket;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.core.IsNull.notNullValue;
@@ -73,7 +73,7 @@ public void testMetricTopLevelDefaultPercents() throws Exception {
.addAggregation(percentilesBucket("percentiles_bucket", termsName + ">sum"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get(termsName);
assertThat(terms, notNullValue());
@@ -110,7 +110,7 @@ public void testWrongPercents() throws Exception {
.addAggregation(percentilesBucket("percentiles_bucket", termsName + ">sum").setPercents(PERCENTS))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get(termsName);
assertThat(terms, notNullValue());
@@ -208,7 +208,7 @@ public void testNestedWithDecimal() throws Exception {
.addAggregation(percentilesBucket("percentile_terms_bucket", termsName + ">percentile_histo_bucket[99.9]").setPercents(percent))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get(termsName);
assertThat(terms, notNullValue());
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java
index dba26d0560a14..6279450e99f49 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/basic/SearchWithRandomIOExceptionsIT.java
@@ -32,8 +32,7 @@
import java.util.Collection;
import java.util.concurrent.ExecutionException;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCountAndNoFailures;
public class SearchWithRandomIOExceptionsIT extends ESIntegTestCase {
@@ -193,9 +192,7 @@ public void testRandomDirectoryIOExceptions() throws IOException, InterruptedExc
indicesAdmin().prepareClose("test").execute().get();
indicesAdmin().prepareOpen("test").execute().get();
ensureGreen();
- SearchResponse searchResponse = client().prepareSearch().setQuery(QueryBuilders.matchQuery("test", "init")).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, numInitialDocs);
+ assertHitCountAndNoFailures(client().prepareSearch().setQuery(QueryBuilders.matchQuery("test", "init")), numInitialDocs);
}
}
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/FetchSubPhasePluginIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/FetchSubPhasePluginIT.java
index a5dad457005cb..fff6386b643f6 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/FetchSubPhasePluginIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/FetchSubPhasePluginIT.java
@@ -39,7 +39,7 @@
import java.util.Objects;
import static java.util.Collections.singletonList;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.CoreMatchers.equalTo;
@@ -75,7 +75,7 @@ public void testPlugin() throws Exception {
SearchResponse response = client().prepareSearch()
.setSource(new SearchSourceBuilder().ext(Collections.singletonList(new TermVectorsFetchBuilder("test"))))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(
((Map) response.getHits().getAt(0).field("term_vectors_fetch").getValues().get(0)).get("i"),
equalTo(2)
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/InnerHitsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/InnerHitsIT.java
index 183f925ced9d3..2a3b8aeede733 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/InnerHitsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/InnerHitsIT.java
@@ -50,6 +50,7 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCountAndNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHit;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHitsWithoutFailures;
@@ -952,9 +953,7 @@ public void testUseMaxDocInsteadOfSize() throws Exception {
QueryBuilder query = nestedQuery("nested", matchQuery("nested.field", "value1"), ScoreMode.Avg).innerHit(
new InnerHitBuilder().setSize(ArrayUtil.MAX_ARRAY_LENGTH - 1)
);
- SearchResponse response = client().prepareSearch("index2").setQuery(query).get();
- assertNoFailures(response);
- assertHitCount(response, 1);
+ assertHitCountAndNoFailures(client().prepareSearch("index2").setQuery(query), 1);
}
public void testTooHighResultWindow() throws Exception {
@@ -966,15 +965,15 @@ public void testTooHighResultWindow() throws Exception {
)
.setRefreshPolicy(IMMEDIATE)
.get();
- SearchResponse response = client().prepareSearch("index2")
- .setQuery(
- nestedQuery("nested", matchQuery("nested.field", "value1"), ScoreMode.Avg).innerHit(
- new InnerHitBuilder().setFrom(50).setSize(10).setName("_name")
- )
- )
- .get();
- assertNoFailures(response);
- assertHitCount(response, 1);
+ assertHitCountAndNoFailures(
+ client().prepareSearch("index2")
+ .setQuery(
+ nestedQuery("nested", matchQuery("nested.field", "value1"), ScoreMode.Avg).innerHit(
+ new InnerHitBuilder().setFrom(50).setSize(10).setName("_name")
+ )
+ ),
+ 1
+ );
Exception e = expectThrows(
SearchPhaseExecutionException.class,
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/highlight/HighlighterSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/highlight/HighlighterSearchIT.java
index 9da65214599e1..642dfc2f6cf54 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/highlight/HighlighterSearchIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fetch/subphase/highlight/HighlighterSearchIT.java
@@ -93,7 +93,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNotHighlighted;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.containsString;
@@ -3349,7 +3348,7 @@ public void testHighlightQueryRewriteDatesWithNow() throws Exception {
)
.get();
- assertSearchResponse(r1);
+ assertNoFailures(r1);
assertThat(r1.getHits().getTotalHits().value, equalTo(1L));
assertHighlight(r1, 0, "field", 0, 1, equalTo("hello world"));
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java
index aaac1d8964877..41917a672206a 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/fields/SearchFieldsIT.java
@@ -63,7 +63,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.hasSize;
@@ -1033,7 +1032,7 @@ public void testScriptFields() throws Exception {
);
}
SearchResponse resp = req.get();
- assertSearchResponse(resp);
+ assertNoFailures(resp);
for (SearchHit hit : resp.getHits().getHits()) {
final int id = Integer.parseInt(hit.getId());
Map fields = hit.getFields();
@@ -1271,7 +1270,7 @@ public void testLoadMetadata() throws Exception {
);
SearchResponse response = client().prepareSearch("test").addStoredField("field1").get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 1);
Map fields = response.getHits().getAt(0).getMetadataFields();
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/ExplainableScriptIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/ExplainableScriptIT.java
index 08697bc1470fb..e9ce09f7455a2 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/ExplainableScriptIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/ExplainableScriptIT.java
@@ -32,7 +32,6 @@
import org.elasticsearch.test.ESIntegTestCase;
import org.elasticsearch.test.ESIntegTestCase.ClusterScope;
import org.elasticsearch.test.ESIntegTestCase.Scope;
-import org.elasticsearch.test.hamcrest.ElasticsearchAssertions;
import java.io.IOException;
import java.util.ArrayList;
@@ -47,6 +46,7 @@
import static org.elasticsearch.index.query.QueryBuilders.termQuery;
import static org.elasticsearch.index.query.functionscore.ScoreFunctionBuilders.scriptFunction;
import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -137,7 +137,7 @@ public void testExplainScript() throws InterruptedException, IOException {
)
).actionGet();
- ElasticsearchAssertions.assertNoFailures(response);
+ assertNoFailures(response);
SearchHits hits = response.getHits();
assertThat(hits.getTotalHits().value, equalTo(20L));
int idCounter = 19;
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreIT.java
index 88e205ce3747c..e32abeb481a2a 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/FunctionScoreIT.java
@@ -40,7 +40,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.search.builder.SearchSourceBuilder.searchSource;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
@@ -94,7 +94,7 @@ public void testScriptScoresNested() throws IOException {
)
)
).actionGet();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getAt(0).getScore(), equalTo(1.0f));
}
@@ -110,7 +110,7 @@ public void testScriptScoresWithAgg() throws IOException {
searchSource().query(functionScoreQuery(scriptFunction(script))).aggregation(terms("score_agg").script(script))
)
).actionGet();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getAt(0).getScore(), equalTo(1.0f));
assertThat(((Terms) response.getAggregations().asMap().get("score_agg")).getBuckets().get(0).getKeyAsString(), equalTo("1.0"));
assertThat(((Terms) response.getAggregations().asMap().get("score_agg")).getBuckets().get(0).getDocCount(), is(1L));
@@ -201,7 +201,7 @@ public void testMinScoreFunctionScoreManyDocsAndRandomMinScore() throws IOExcept
}
protected void assertMinScoreSearchResponses(int numDocs, SearchResponse searchResponse, int numMatchingDocs) {
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat((int) searchResponse.getHits().getTotalHits().value, is(numMatchingDocs));
int pos = 0;
for (int hitId = numDocs - 1; (numDocs - hitId) < searchResponse.getHits().getTotalHits().value; hitId--) {
@@ -219,7 +219,7 @@ public void testWithEmptyFunctions() throws IOException, ExecutionException, Int
SearchResponse termQuery = client().search(
new SearchRequest(new String[] {}).source(searchSource().explain(true).query(termQuery("text", "text")))
).get();
- assertSearchResponse(termQuery);
+ assertNoFailures(termQuery);
assertThat(termQuery.getHits().getTotalHits().value, equalTo(1L));
float termQueryScore = termQuery.getHits().getAt(0).getScore();
@@ -234,7 +234,7 @@ protected void testMinScoreApplied(CombineFunction boostMode, float expectedScor
searchSource().explain(true).query(functionScoreQuery(termQuery("text", "text")).boostMode(boostMode).setMinScore(0.1f))
)
).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(1L));
assertThat(response.getHits().getAt(0).getScore(), equalTo(expectedScore));
@@ -244,7 +244,7 @@ protected void testMinScoreApplied(CombineFunction boostMode, float expectedScor
)
).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(0L));
}
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/QueryRescorerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/QueryRescorerIT.java
index 109d391fd17fc..ecb4be2685ab0 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/QueryRescorerIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/functionscore/QueryRescorerIT.java
@@ -49,7 +49,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFourthHit;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSecondHit;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertThirdHit;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.hasId;
@@ -85,7 +84,7 @@ public void testEnforceWindowSize() {
)
.setSize(randomIntBetween(2, 10))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertFirstHit(searchResponse, hasScore(100.f));
int numDocsWith100AsAScore = 0;
for (int i = 0; i < searchResponse.getHits().getHits().length; i++) {
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPointScriptDocValuesIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPointScriptDocValuesIT.java
index 55994458388a4..90b942c576a82 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPointScriptDocValuesIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/geo/GeoPointScriptDocValuesIT.java
@@ -36,7 +36,7 @@
import java.util.function.Function;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.is;
@@ -164,7 +164,7 @@ public void testRandomPoint() throws Exception {
.addScriptField("label_lat", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "label_lat", Collections.emptyMap()))
.addScriptField("label_lon", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "label_lon", Collections.emptyMap()))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
final double qLat = GeoEncodingUtils.decodeLatitude(GeoEncodingUtils.encodeLatitude(lat));
final double qLon = GeoEncodingUtils.decodeLongitude(GeoEncodingUtils.encodeLongitude(lon));
@@ -208,7 +208,7 @@ public void testRandomMultiPoint() throws Exception {
.addScriptField("label_lat", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "label_lat", Collections.emptyMap()))
.addScriptField("label_lon", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "label_lon", Collections.emptyMap()))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
for (int i = 0; i < size; i++) {
lats[i] = GeoEncodingUtils.decodeLatitude(GeoEncodingUtils.encodeLatitude(lats[i]));
@@ -247,7 +247,7 @@ public void testNullPoint() throws Exception {
.addScriptField("height", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "height", Collections.emptyMap()))
.addScriptField("width", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "width", Collections.emptyMap()))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Map fields = searchResponse.getHits().getHits()[0].getFields();
assertThat(fields.get("lat").getValue(), equalTo(Double.NaN));
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/morelikethis/MoreLikeThisIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/morelikethis/MoreLikeThisIT.java
index 5a8b506b99296..659f6af68d612 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/morelikethis/MoreLikeThisIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/morelikethis/MoreLikeThisIT.java
@@ -43,7 +43,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertOrderedSearchHits;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertRequestBuilderThrows;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.instanceOf;
@@ -609,7 +608,7 @@ public void testMoreLikeThisMultiValueFields() throws Exception {
.maxQueryTerms(max_query_terms)
.minimumShouldMatch("0%");
SearchResponse response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, max_query_terms);
}
}
@@ -642,7 +641,7 @@ public void testMinimumShouldMatch() throws ExecutionException, InterruptedExcep
.minimumShouldMatch(minimumShouldMatch);
logger.info("Testing with minimum_should_match = {}", minimumShouldMatch);
SearchResponse response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
if (minimumShouldMatch.equals("0%")) {
assertHitCount(response, 10);
} else {
@@ -672,7 +671,7 @@ public void testMoreLikeThisArtificialDocs() throws Exception {
.maxQueryTerms(100)
.minimumShouldMatch("100%"); // strict all terms must match!
SearchResponse response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 1);
}
@@ -698,14 +697,14 @@ public void testMoreLikeThisMalformedArtificialDocs() throws Exception {
.minDocFreq(0)
.minimumShouldMatch("0%");
SearchResponse response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 0);
logger.info("Checking with an empty document ...");
XContentBuilder emptyDoc = jsonBuilder().startObject().endObject();
mltQuery = moreLikeThisQuery(null, new Item[] { new Item("test", emptyDoc) }).minTermFreq(0).minDocFreq(0).minimumShouldMatch("0%");
response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 0);
logger.info("Checking the document matches otherwise ...");
@@ -717,7 +716,7 @@ public void testMoreLikeThisMalformedArtificialDocs() throws Exception {
.minDocFreq(0)
.minimumShouldMatch("100%"); // strict all terms must match but date is ignored
response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 1);
}
@@ -746,7 +745,7 @@ public void testMoreLikeThisUnlike() throws ExecutionException, InterruptedExcep
.maxQueryTerms(100)
.minimumShouldMatch("0%");
SearchResponse response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, numFields);
logger.info("Now check like this doc, but ignore one doc in the index, then two and so on...");
@@ -761,7 +760,7 @@ public void testMoreLikeThisUnlike() throws ExecutionException, InterruptedExcep
.minimumShouldMatch("0%");
response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, numFields - (i + 1));
}
}
@@ -785,7 +784,7 @@ public void testSelectFields() throws IOException, ExecutionException, Interrupt
.include(true)
.minimumShouldMatch("1%");
SearchResponse response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 2);
mltQuery = moreLikeThisQuery(new String[] { "text" }, null, new Item[] { new Item("test", "1") }).minTermFreq(0)
@@ -793,7 +792,7 @@ public void testSelectFields() throws IOException, ExecutionException, Interrupt
.include(true)
.minimumShouldMatch("1%");
response = client().prepareSearch("test").setQuery(mltQuery).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 1);
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java
index d89f39a1452b6..e981c1fd5c0c0 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/profile/aggregation/AggregationProfilerIT.java
@@ -42,7 +42,7 @@
import static org.elasticsearch.test.MapMatcher.assertMap;
import static org.elasticsearch.test.MapMatcher.matchesMap;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
@@ -127,7 +127,7 @@ public void testSimpleProfile() {
.setProfile(true)
.addAggregation(histogram("histo").field(NUMBER_FIELD).interval(1L))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Map profileResults = response.getProfileResults();
assertThat(profileResults, notNullValue());
assertThat(profileResults.size(), equalTo(getNumShards("idx").numPrimaries));
@@ -171,7 +171,7 @@ public void testMultiLevelProfile() {
)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Map profileResults = response.getProfileResults();
assertThat(profileResults, notNullValue());
assertThat(profileResults.size(), equalTo(getNumShards("idx").numPrimaries));
@@ -258,7 +258,7 @@ public void testMultiLevelProfileBreadthFirst() {
)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Map profileResults = response.getProfileResults();
assertThat(profileResults, notNullValue());
assertThat(profileResults.size(), equalTo(getNumShards("idx").numPrimaries));
@@ -329,7 +329,7 @@ public void testDiversifiedAggProfile() {
.subAggregation(max("max").field(NUMBER_FIELD))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Map profileResults = response.getProfileResults();
assertThat(profileResults, notNullValue());
assertThat(profileResults.size(), equalTo(getNumShards("idx").numPrimaries));
@@ -398,7 +398,7 @@ public void testComplexProfile() {
)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Map profileResults = response.getProfileResults();
assertThat(profileResults, notNullValue());
assertThat(profileResults.size(), equalTo(getNumShards("idx").numPrimaries));
@@ -615,7 +615,7 @@ public void testNoProfile() {
)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Map profileResults = response.getProfileResults();
assertThat(profileResults, notNullValue());
assertThat(profileResults.size(), equalTo(0));
@@ -652,7 +652,7 @@ public void testFilterByFilter() throws InterruptedException, IOException {
.subAggregation(new MaxAggregationBuilder("m").field("date"))
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Map profileResults = response.getProfileResults();
assertThat(profileResults, notNullValue());
assertThat(profileResults.size(), equalTo(getNumShards("dateidx").numPrimaries));
@@ -724,7 +724,7 @@ public void testDateHistogramFilterByFilterDisabled() throws InterruptedExceptio
.setProfile(true)
.addAggregation(new DateHistogramAggregationBuilder("histo").field("date").calendarInterval(DateHistogramInterval.MONTH))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Map profileResults = response.getProfileResults();
assertThat(profileResults, notNullValue());
assertThat(profileResults.size(), equalTo(getNumShards("date_filter_by_filter_disabled").numPrimaries));
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/query/ExistsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/query/ExistsIT.java
index dd3e160054f6b..45f8b47efd870 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/query/ExistsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/query/ExistsIT.java
@@ -31,7 +31,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
public class ExistsIT extends ESIntegTestCase {
@@ -115,14 +114,14 @@ public void testExists() throws Exception {
final long numDocs = sources.length;
SearchResponse allDocs = client().prepareSearch("idx").setSize(sources.length).get();
- assertSearchResponse(allDocs);
+ assertNoFailures(allDocs);
assertHitCount(allDocs, numDocs);
for (Map.Entry entry : expected.entrySet()) {
final String fieldName = entry.getKey();
final int count = entry.getValue();
// exists
SearchResponse resp = client().prepareSearch("idx").setQuery(QueryBuilders.existsQuery(fieldName)).get();
- assertSearchResponse(resp);
+ assertNoFailures(resp);
try {
assertEquals(
String.format(
@@ -201,7 +200,7 @@ public void testFieldAlias() throws Exception {
int expectedCount = entry.getValue();
SearchResponse response = client().prepareSearch("idx").setQuery(QueryBuilders.existsQuery(fieldName)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, expectedCount);
}
}
@@ -233,7 +232,7 @@ public void testFieldAliasWithNoDocValues() throws Exception {
indexRandom(true, false, indexRequests);
SearchResponse response = client().prepareSearch("idx").setQuery(QueryBuilders.existsQuery("foo-alias")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 2);
}
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/query/SearchQueryIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/query/SearchQueryIT.java
index be265cb3985e6..c35bfee6e73d7 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/query/SearchQueryIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/query/SearchQueryIT.java
@@ -104,10 +104,10 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFirstHit;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCountAndNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHitsWithoutFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSecondHit;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.hasId;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.hasScore;
@@ -452,9 +452,10 @@ public void testTermIndexQuery() throws Exception {
);
}
{
- SearchResponse request = client().prepareSearch().setQuery(constantScoreQuery(termsQuery("_index", indexNames))).get();
- SearchResponse searchResponse = assertSearchResponse(request);
- assertHitCount(searchResponse, indexNames.length);
+ assertHitCountAndNoFailures(
+ client().prepareSearch().setQuery(constantScoreQuery(termsQuery("_index", indexNames))),
+ indexNames.length
+ );
}
}
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollIT.java
index 3b459f8d57934..6b6192ddcce96 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/scroll/SearchScrollIT.java
@@ -50,7 +50,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoSearchHits;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertRequestBuilderThrows;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -517,7 +516,7 @@ public void testStringSortMissingAscTerminates() throws Exception {
assertSearchHits(response, "1");
response = client().prepareSearchScroll(response.getScrollId()).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 1);
assertNoSearchHits(response);
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java
index d71345a42dd2c..61bdeb0f6ade3 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/simple/SimpleSearchIT.java
@@ -46,6 +46,7 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCountAndNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -190,29 +191,25 @@ public void testSimpleDateRange() throws Exception {
client().prepareIndex("test").setId("3").setSource("field", "1967-01-01T00:00").get();
ensureGreen();
refresh();
- SearchResponse searchResponse = client().prepareSearch("test")
- .setQuery(QueryBuilders.rangeQuery("field").gte("2010-01-03||+2d").lte("2010-01-04||+2d/d"))
- .get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 2L);
+ assertHitCountAndNoFailures(
+ client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("2010-01-03||+2d").lte("2010-01-04||+2d/d")),
+ 2L
+ );
- searchResponse = client().prepareSearch("test")
- .setQuery(QueryBuilders.rangeQuery("field").gte("2010-01-05T02:00").lte("2010-01-06T02:00"))
- .get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 2L);
+ assertHitCountAndNoFailures(
+ client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("2010-01-05T02:00").lte("2010-01-06T02:00")),
+ 2L
+ );
- searchResponse = client().prepareSearch("test")
- .setQuery(QueryBuilders.rangeQuery("field").gte("2010-01-05T02:00").lt("2010-01-06T02:00"))
- .get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 1L);
+ assertHitCountAndNoFailures(
+ client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("2010-01-05T02:00").lt("2010-01-06T02:00")),
+ 1L
+ );
- searchResponse = client().prepareSearch("test")
- .setQuery(QueryBuilders.rangeQuery("field").gt("2010-01-05T02:00").lt("2010-01-06T02:00"))
- .get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 0L);
+ assertHitCountAndNoFailures(
+ client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt("2010-01-05T02:00").lt("2010-01-06T02:00")),
+ 0L
+ );
assertHitCount(
client().prepareSearch("test").setQuery(QueryBuilders.queryStringQuery("field:[2010-01-03||+2d TO 2010-01-04||+2d/d]")),
@@ -220,12 +217,10 @@ public void testSimpleDateRange() throws Exception {
);
// a string value of "1000" should be parsed as the year 1000 and return all three docs
- searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt("1000")).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 3L);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt("1000")), 3L);
// a numeric value of 1000 should be parsed as 1000 millis since epoch and return only docs after 1970
- searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt(1000)).get();
+ SearchResponse searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt(1000)).get();
assertNoFailures(searchResponse);
assertHitCount(searchResponse, 2L);
String[] expectedIds = new String[] { "1", "2" };
@@ -245,37 +240,14 @@ public void testRangeQueryKeyword() throws Exception {
ensureGreen();
refresh();
- SearchResponse searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("A").lte("B")).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 2L);
-
- searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt("A").lte("B")).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 1L);
-
- searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("A").lt("B")).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 1L);
-
- searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte(null).lt("C")).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 3L);
-
- searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("B").lt(null)).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 2L);
-
- searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt(null).lt(null)).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 4L);
-
- searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("").lt(null)).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 4L);
-
- searchResponse = client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt("").lt(null)).get();
- assertNoFailures(searchResponse);
- assertHitCount(searchResponse, 3L);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("A").lte("B")), 2L);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt("A").lte("B")), 1L);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("A").lt("B")), 1L);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte(null).lt("C")), 3L);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("B").lt(null)), 2L);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt(null).lt(null)), 4L);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gte("").lt(null)), 4L);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(QueryBuilders.rangeQuery("field").gt("").lt(null)), 3L);
}
public void testSimpleTerminateAfterCount() throws Exception {
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java
index 3b6f29fd1ec90..2adadc5e34fb6 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/sort/FieldSortIT.java
@@ -63,7 +63,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertFirstHit;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSecondHit;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.hasId;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
@@ -126,7 +125,7 @@ public void testIssue8226() {
.setSize(10)
.get();
logClusterState();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
for (int j = 1; j < searchResponse.getHits().getHits().length; j++) {
Number current = (Number) searchResponse.getHits().getHits()[j].getSourceAsMap().get("entry");
@@ -140,7 +139,7 @@ public void testIssue8226() {
.setSize(10)
.get();
logClusterState();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
for (int j = 1; j < searchResponse.getHits().getHits().length; j++) {
Number current = (Number) searchResponse.getHits().getHits()[j].getSourceAsMap().get("entry");
@@ -184,7 +183,7 @@ public void testIssue6614() throws ExecutionException, InterruptedException {
.addSort(new FieldSortBuilder("timeUpdated").order(SortOrder.ASC).unmappedType("date"))
.setSize(docs)
.get();
- assertSearchResponse(allDocsResponse);
+ assertNoFailures(allDocsResponse);
final int numiters = randomIntBetween(1, 20);
for (int i = 0; i < numiters; i++) {
@@ -197,7 +196,7 @@ public void testIssue6614() throws ExecutionException, InterruptedException {
.addSort(new FieldSortBuilder("timeUpdated").order(SortOrder.ASC).unmappedType("date"))
.setSize(scaledRandomIntBetween(1, docs))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
for (int j = 0; j < searchResponse.getHits().getHits().length; j++) {
assertThat(
searchResponse.toString() + "\n vs. \n" + allDocsResponse.toString(),
@@ -1765,13 +1764,13 @@ public void testCustomFormat() throws Exception {
);
SearchResponse response = client().prepareSearch("test").addSort(SortBuilders.fieldSort("ip")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertEquals(2, response.getHits().getTotalHits().value);
assertArrayEquals(new String[] { "192.168.1.7" }, response.getHits().getAt(0).getSortValues());
assertArrayEquals(new String[] { "2001:db8::ff00:42:8329" }, response.getHits().getAt(1).getSortValues());
response = client().prepareSearch("test").addSort(SortBuilders.fieldSort("ip")).searchAfter(new Object[] { "192.168.1.7" }).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertEquals(2, response.getHits().getTotalHits().value);
assertEquals(1, response.getHits().getHits().length);
assertArrayEquals(new String[] { "2001:db8::ff00:42:8329" }, response.getHits().getAt(0).getSortValues());
@@ -2080,7 +2079,7 @@ public void testLongSortOptimizationCorrectResults() {
.addSort(new FieldSortBuilder("long_field").order(SortOrder.DESC))
.setSize(10)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
long previousLong = Long.MAX_VALUE;
for (int i = 0; i < searchResponse.getHits().getHits().length; i++) {
// check the correct sort order
@@ -2092,7 +2091,7 @@ public void testLongSortOptimizationCorrectResults() {
// *** 2. sort ASC on long_field
searchResponse = client().prepareSearch().addSort(new FieldSortBuilder("long_field").order(SortOrder.ASC)).setSize(10).get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
previousLong = Long.MIN_VALUE;
for (int i = 0; i < searchResponse.getHits().getHits().length; i++) {
// check the correct sort order
@@ -2120,7 +2119,7 @@ public void testSortMixedFieldTypes() {
.addSort(new FieldSortBuilder("foo"))
.setSize(10)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
}
String errMsg = "Can't sort on field [foo]; the field has incompatible sort types";
diff --git a/server/src/internalClusterTest/java/org/elasticsearch/search/stats/SearchStatsIT.java b/server/src/internalClusterTest/java/org/elasticsearch/search/stats/SearchStatsIT.java
index fa996a6bd0e89..28e3cc3cf1b87 100644
--- a/server/src/internalClusterTest/java/org/elasticsearch/search/stats/SearchStatsIT.java
+++ b/server/src/internalClusterTest/java/org/elasticsearch/search/stats/SearchStatsIT.java
@@ -39,7 +39,7 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAllSuccessful;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
@@ -193,7 +193,7 @@ public void testOpenContexts() {
.setSize(size)
.setScroll(TimeValue.timeValueMinutes(2))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
// refresh the stats now that scroll contexts are opened
indicesStats = indicesAdmin().prepareStats(index).get();
diff --git a/server/src/test/java/org/elasticsearch/index/fieldstats/FieldStatsProviderRefreshTests.java b/server/src/test/java/org/elasticsearch/index/fieldstats/FieldStatsProviderRefreshTests.java
index 5c35733feedef..b1b04550d22f2 100644
--- a/server/src/test/java/org/elasticsearch/index/fieldstats/FieldStatsProviderRefreshTests.java
+++ b/server/src/test/java/org/elasticsearch/index/fieldstats/FieldStatsProviderRefreshTests.java
@@ -18,7 +18,7 @@
import org.elasticsearch.test.ESSingleNodeTestCase;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.anyOf;
import static org.hamcrest.Matchers.equalTo;
@@ -48,7 +48,7 @@ public void testQueryRewriteOnRefresh() throws Exception {
.setSize(0)
.setQuery(QueryBuilders.rangeQuery("s").gte("a").lte("g"))
.get();
- assertSearchResponse(r1);
+ assertNoFailures(r1);
assertThat(r1.getHits().getTotalHits().value, equalTo(3L));
assertRequestCacheStats(0, 1);
@@ -58,7 +58,7 @@ public void testQueryRewriteOnRefresh() throws Exception {
.setSize(0)
.setQuery(QueryBuilders.rangeQuery("s").gte("a").lte("g"))
.get();
- assertSearchResponse(r2);
+ assertNoFailures(r2);
assertThat(r2.getHits().getTotalHits().value, equalTo(3L));
assertRequestCacheStats(1, 1);
@@ -73,7 +73,7 @@ public void testQueryRewriteOnRefresh() throws Exception {
.setSize(0)
.setQuery(QueryBuilders.rangeQuery("s").gte("a").lte("g"))
.get();
- assertSearchResponse(r3);
+ assertNoFailures(r3);
assertThat(r3.getHits().getTotalHits().value, equalTo(5L));
assertRequestCacheStats(1, 2);
}
diff --git a/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldSearchTests.java b/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldSearchTests.java
index 709223d19788c..20d307a0d4cb1 100644
--- a/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldSearchTests.java
+++ b/server/src/test/java/org/elasticsearch/index/mapper/flattened/FlattenedFieldSearchTests.java
@@ -40,9 +40,9 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.cardinality;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCountAndNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertOrderedSearchHits;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.hamcrest.CoreMatchers.startsWith;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThan;
@@ -131,17 +131,12 @@ public void testQueryStringQuery() throws Exception {
)
.get();
- SearchResponse response = client().prepareSearch("test").setQuery(queryStringQuery("flattened.field1:value")).get();
- assertSearchResponse(response);
- assertHitCount(response, 1);
-
- response = client().prepareSearch("test").setQuery(queryStringQuery("flattened.field1:value AND flattened:2.718")).get();
- assertSearchResponse(response);
- assertHitCount(response, 1);
-
- response = client().prepareSearch("test").setQuery(queryStringQuery("2.718").field("flattened.field2")).get();
- assertSearchResponse(response);
- assertHitCount(response, 1);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(queryStringQuery("flattened.field1:value")), 1);
+ assertHitCountAndNoFailures(
+ client().prepareSearch("test").setQuery(queryStringQuery("flattened.field1:value AND flattened:2.718")),
+ 1
+ );
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(queryStringQuery("2.718").field("flattened.field2")), 1);
}
public void testSimpleQueryStringQuery() throws Exception {
@@ -159,17 +154,9 @@ public void testSimpleQueryStringQuery() throws Exception {
)
.get();
- SearchResponse response = client().prepareSearch("test").setQuery(simpleQueryStringQuery("value").field("flattened.field1")).get();
- assertSearchResponse(response);
- assertHitCount(response, 1);
-
- response = client().prepareSearch("test").setQuery(simpleQueryStringQuery("+value +2.718").field("flattened")).get();
- assertSearchResponse(response);
- assertHitCount(response, 1);
-
- response = client().prepareSearch("test").setQuery(simpleQueryStringQuery("+value +3.141").field("flattened")).get();
- assertSearchResponse(response);
- assertHitCount(response, 0);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(simpleQueryStringQuery("value").field("flattened.field1")), 1);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(simpleQueryStringQuery("+value +2.718").field("flattened")), 1);
+ assertHitCountAndNoFailures(client().prepareSearch("test").setQuery(simpleQueryStringQuery("+value +3.141").field("flattened")), 0);
}
public void testExists() throws Exception {
@@ -226,7 +213,7 @@ public void testCardinalityAggregation() throws IOException {
.addAggregation(cardinality("cardinality").precisionThreshold(precisionThreshold).field("flattened"))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Cardinality count = response.getAggregations().get("cardinality");
assertCardinality(count, numDocs, precisionThreshold);
@@ -234,7 +221,7 @@ public void testCardinalityAggregation() throws IOException {
SearchResponse firstResponse = client().prepareSearch("test")
.addAggregation(cardinality("cardinality").precisionThreshold(precisionThreshold).field("flattened.first"))
.get();
- assertSearchResponse(firstResponse);
+ assertNoFailures(firstResponse);
Cardinality firstCount = firstResponse.getAggregations().get("cardinality");
assertCardinality(firstCount, numDocs, precisionThreshold);
@@ -242,7 +229,7 @@ public void testCardinalityAggregation() throws IOException {
SearchResponse secondResponse = client().prepareSearch("test")
.addAggregation(cardinality("cardinality").precisionThreshold(precisionThreshold).field("flattened.second"))
.get();
- assertSearchResponse(secondResponse);
+ assertNoFailures(secondResponse);
Cardinality secondCount = secondResponse.getAggregations().get("cardinality");
assertCardinality(secondCount, (numDocs + 1) / 2, precisionThreshold);
@@ -281,7 +268,7 @@ public void testTermsAggregation() throws IOException {
// Aggregate on the root 'labels' field.
TermsAggregationBuilder builder = createTermsAgg("labels");
SearchResponse response = client().prepareSearch("test").addAggregation(builder).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -299,7 +286,7 @@ public void testTermsAggregation() throws IOException {
// Aggregate on the 'priority' subfield.
TermsAggregationBuilder priorityAgg = createTermsAgg("labels.priority");
SearchResponse priorityResponse = client().prepareSearch("test").addAggregation(priorityAgg).get();
- assertSearchResponse(priorityResponse);
+ assertNoFailures(priorityResponse);
Terms priorityTerms = priorityResponse.getAggregations().get("terms");
assertThat(priorityTerms, notNullValue());
@@ -313,7 +300,7 @@ public void testTermsAggregation() throws IOException {
// Aggregate on the 'release' subfield.
TermsAggregationBuilder releaseAgg = createTermsAgg("labels.release");
SearchResponse releaseResponse = client().prepareSearch("test").addAggregation(releaseAgg).get();
- assertSearchResponse(releaseResponse);
+ assertNoFailures(releaseResponse);
Terms releaseTerms = releaseResponse.getAggregations().get("terms");
assertThat(releaseTerms, notNullValue());
@@ -328,7 +315,7 @@ public void testTermsAggregation() throws IOException {
// Aggregate on the 'priority' subfield with a min_doc_count of 0.
TermsAggregationBuilder minDocCountAgg = createTermsAgg("labels.priority").minDocCount(0);
SearchResponse minDocCountResponse = client().prepareSearch("test").addAggregation(minDocCountAgg).get();
- assertSearchResponse(minDocCountResponse);
+ assertNoFailures(minDocCountResponse);
Terms minDocCountTerms = minDocCountResponse.getAggregations().get("terms");
assertThat(minDocCountTerms, notNullValue());
@@ -359,7 +346,7 @@ public void testLoadDocValuesFields() throws Exception {
.get();
SearchResponse response = client().prepareSearch("test").addDocValueField("flattened").addDocValueField("flattened.key").get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 1);
Map fields = response.getHits().getAt(0).getFields();
@@ -409,17 +396,17 @@ public void testFieldSort() throws Exception {
.get();
SearchResponse response = client().prepareSearch("test").addSort("flattened", SortOrder.DESC).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 3);
assertOrderedSearchHits(response, "3", "1", "2");
response = client().prepareSearch("test").addSort("flattened.key", SortOrder.DESC).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 3);
assertOrderedSearchHits(response, "2", "1", "3");
response = client().prepareSearch("test").addSort(new FieldSortBuilder("flattened.key").order(SortOrder.DESC).missing("Z")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertHitCount(response, 3);
assertOrderedSearchHits(response, "3", "2", "1");
}
diff --git a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/ShardSizeTestCase.java b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/ShardSizeTestCase.java
index 80eb0c4ac6bbb..8b7731c6b3505 100644
--- a/server/src/test/java/org/elasticsearch/search/aggregations/bucket/ShardSizeTestCase.java
+++ b/server/src/test/java/org/elasticsearch/search/aggregations/bucket/ShardSizeTestCase.java
@@ -18,7 +18,7 @@
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.is;
@@ -79,11 +79,11 @@ protected void indexData() throws Exception {
indexRandom(true, docs);
SearchResponse resp = client().prepareSearch("idx").setRouting(routing1).setQuery(matchAllQuery()).get();
- assertSearchResponse(resp);
+ assertNoFailures(resp);
long totalOnOne = resp.getHits().getTotalHits().value;
assertThat(totalOnOne, is(15L));
resp = client().prepareSearch("idx").setRouting(routing2).setQuery(matchAllQuery()).get();
- assertSearchResponse(resp);
+ assertNoFailures(resp);
long totalOnTwo = resp.getHits().getTotalHits().value;
assertThat(totalOnTwo, is(12L));
}
diff --git a/server/src/test/java/org/elasticsearch/test/search/aggregations/bucket/SharedSignificantTermsTestMethods.java b/server/src/test/java/org/elasticsearch/test/search/aggregations/bucket/SharedSignificantTermsTestMethods.java
index 1ec8a48b5d168..9ef137cefeeb3 100644
--- a/server/src/test/java/org/elasticsearch/test/search/aggregations/bucket/SharedSignificantTermsTestMethods.java
+++ b/server/src/test/java/org/elasticsearch/test/search/aggregations/bucket/SharedSignificantTermsTestMethods.java
@@ -28,7 +28,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
import static org.elasticsearch.test.ESIntegTestCase.client;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.equalTo;
public class SharedSignificantTermsTestMethods {
@@ -51,7 +51,7 @@ private static void checkSignificantTermsAggregationCorrect(ESIntegTestCase test
.addAggregation(terms("class").field(CLASS_FIELD).subAggregation(significantTerms("sig_terms").field(TEXT_FIELD)))
.execute()
.actionGet();
- assertSearchResponse(response);
+ assertNoFailures(response);
StringTerms classes = response.getAggregations().get("class");
Assert.assertThat(classes.getBuckets().size(), equalTo(2));
for (Terms.Bucket classBucket : classes.getBuckets()) {
diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/bucket/AbstractTermsTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/bucket/AbstractTermsTestCase.java
index c2c2f9dbef7f5..9bfe15cb7f0b9 100644
--- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/bucket/AbstractTermsTestCase.java
+++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/bucket/AbstractTermsTestCase.java
@@ -15,7 +15,7 @@
import org.elasticsearch.search.aggregations.bucket.terms.TermsAggregatorFactory.ExecutionMode;
import org.elasticsearch.test.ESIntegTestCase;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
public abstract class AbstractTermsTestCase extends ESIntegTestCase {
@@ -41,7 +41,7 @@ public void testOtherDocCount(String... fieldNames) {
.collectMode(randomFrom(SubAggCollectionMode.values()))
)
.get();
- assertSearchResponse(allTerms);
+ assertNoFailures(allTerms);
Terms terms = allTerms.getAggregations().get("terms");
assertEquals(0, terms.getSumOfOtherDocCounts()); // size is 0
@@ -59,7 +59,7 @@ public void testOtherDocCount(String... fieldNames) {
.collectMode(randomFrom(SubAggCollectionMode.values()))
)
.get();
- assertSearchResponse(resp);
+ assertNoFailures(resp);
terms = resp.getAggregations().get("terms");
assertEquals(Math.min(size, totalNumTerms), terms.getBuckets().size());
assertEquals(sumOfDocCounts, sumOfDocCounts(terms));
diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractGeoTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractGeoTestCase.java
index 1af8eb8dab82b..571e269bf532d 100644
--- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractGeoTestCase.java
+++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/AbstractGeoTestCase.java
@@ -30,7 +30,7 @@
import java.util.Map;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
@@ -234,7 +234,7 @@ public void setupSuiteScopeCluster() throws Exception {
.addSort(SortBuilders.fieldSort(NUMBER_FIELD_NAME).order(SortOrder.ASC))
.setSize(5000)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
long totalHits = response.getHits().getTotalHits().value;
XContentBuilder builder = XContentFactory.jsonBuilder();
ChunkedToXContent.wrapAsToXContent(response).toXContent(builder, ToXContent.EMPTY_PARAMS);
diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/CentroidAggregationTestBase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/CentroidAggregationTestBase.java
index f211216226285..5af696fb644d3 100644
--- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/CentroidAggregationTestBase.java
+++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/CentroidAggregationTestBase.java
@@ -18,7 +18,7 @@
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.search.aggregations.AggregationBuilders.global;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue;
@@ -38,7 +38,7 @@ public void testEmptyAggregation() {
.setQuery(matchAllQuery())
.addAggregation(centroidAgg(aggName()).field(SINGLE_VALUED_FIELD_NAME))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
CentroidAggregation geoCentroid = response.getAggregations().get(aggName());
assertThat(response.getHits().getTotalHits().value, equalTo(0L));
@@ -52,7 +52,7 @@ public void testUnmapped() throws Exception {
SearchResponse response = client().prepareSearch(UNMAPPED_IDX_NAME)
.addAggregation(centroidAgg(aggName()).field(SINGLE_VALUED_FIELD_NAME))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
CentroidAggregation geoCentroid = response.getAggregations().get(aggName());
assertThat(geoCentroid, notNullValue());
@@ -65,7 +65,7 @@ public void testPartiallyUnmapped() {
SearchResponse response = client().prepareSearch(IDX_NAME, UNMAPPED_IDX_NAME)
.addAggregation(centroidAgg(aggName()).field(SINGLE_VALUED_FIELD_NAME))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
CentroidAggregation geoCentroid = response.getAggregations().get(aggName());
assertThat(geoCentroid, notNullValue());
@@ -79,7 +79,7 @@ public void testSingleValuedField() {
.setQuery(matchAllQuery())
.addAggregation(centroidAgg(aggName()).field(SINGLE_VALUED_FIELD_NAME))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
CentroidAggregation geoCentroid = response.getAggregations().get(aggName());
assertThat(geoCentroid, notNullValue());
@@ -93,7 +93,7 @@ public void testSingleValueFieldGetProperty() {
.setQuery(matchAllQuery())
.addAggregation(global("global").subAggregation(centroidAgg(aggName()).field(SINGLE_VALUED_FIELD_NAME)))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Global global = response.getAggregations().get("global");
assertThat(global, notNullValue());
@@ -120,7 +120,7 @@ public void testMultiValuedField() throws Exception {
.setQuery(matchAllQuery())
.addAggregation(centroidAgg(aggName()).field(MULTI_VALUED_FIELD_NAME))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
CentroidAggregation geoCentroid = searchResponse.getAggregations().get(aggName());
assertThat(geoCentroid, notNullValue());
diff --git a/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/SpatialBoundsAggregationTestBase.java b/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/SpatialBoundsAggregationTestBase.java
index ac366576c8975..1b318eb4952c2 100644
--- a/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/SpatialBoundsAggregationTestBase.java
+++ b/test/framework/src/main/java/org/elasticsearch/search/aggregations/metrics/SpatialBoundsAggregationTestBase.java
@@ -23,7 +23,7 @@
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.search.aggregations.AggregationBuilders.global;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.hamcrest.Matchers.closeTo;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.notNullValue;
@@ -41,7 +41,7 @@ public abstract class SpatialBoundsAggregationTestBase e
public void testSingleValuedField() throws Exception {
SearchResponse response = client().prepareSearch(IDX_NAME).addAggregation(boundsAgg(aggName(), SINGLE_VALUED_FIELD_NAME)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SpatialBounds geoBounds = response.getAggregations().get(aggName());
assertThat(geoBounds, notNullValue());
@@ -60,7 +60,7 @@ public void testSingleValuedField_getProperty() {
.addAggregation(global("global").subAggregation(boundsAgg(aggName(), SINGLE_VALUED_FIELD_NAME)))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Global global = searchResponse.getAggregations().get("global");
assertThat(global, notNullValue());
@@ -100,7 +100,7 @@ public void testSingleValuedField_getProperty() {
public void testMultiValuedField() throws Exception {
SearchResponse response = client().prepareSearch(IDX_NAME).addAggregation(boundsAgg(aggName(), MULTI_VALUED_FIELD_NAME)).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SpatialBounds geoBounds = response.getAggregations().get(aggName());
assertThat(geoBounds, notNullValue());
@@ -118,7 +118,7 @@ public void testUnmapped() throws Exception {
.addAggregation(boundsAgg(aggName(), SINGLE_VALUED_FIELD_NAME))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SpatialBounds geoBounds = response.getAggregations().get(aggName());
assertThat(geoBounds, notNullValue());
@@ -134,7 +134,7 @@ public void testPartiallyUnmapped() throws Exception {
.addAggregation(boundsAgg(aggName(), SINGLE_VALUED_FIELD_NAME))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SpatialBounds geoBounds = response.getAggregations().get(aggName());
assertThat(geoBounds, notNullValue());
@@ -171,7 +171,7 @@ public void testSingleValuedFieldAsSubAggToHighCardTermsAgg() {
.addAggregation(terms("terms").field(NUMBER_FIELD_NAME).subAggregation(boundsAgg(aggName(), SINGLE_VALUED_FIELD_NAME)))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("terms");
assertThat(terms, notNullValue());
@@ -194,7 +194,7 @@ public void testSingleValuedFieldWithZeroLon() {
.addAggregation(boundsAgg(aggName(), SINGLE_VALUED_FIELD_NAME))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SpatialBounds geoBounds = response.getAggregations().get(aggName());
assertThat(geoBounds, notNullValue());
diff --git a/test/framework/src/main/java/org/elasticsearch/search/geo/BasePointShapeQueryTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/geo/BasePointShapeQueryTestCase.java
index 69698bc535b06..6abce04556316 100644
--- a/test/framework/src/main/java/org/elasticsearch/search/geo/BasePointShapeQueryTestCase.java
+++ b/test/framework/src/main/java/org/elasticsearch/search/geo/BasePointShapeQueryTestCase.java
@@ -47,7 +47,7 @@
import java.util.Map;
import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -115,7 +115,7 @@ public void testIndexPointsFilterRectangle() throws Exception {
.setQuery(queryBuilder().shapeQuery(defaultFieldName, geometry).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("1"));
@@ -123,7 +123,7 @@ public void testIndexPointsFilterRectangle() throws Exception {
// default query, without specifying relation (expect intersects)
searchResponse = client().prepareSearch(defaultIndexName).setQuery(queryBuilder().shapeQuery(defaultFieldName, geometry)).get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("1"));
@@ -181,7 +181,7 @@ public void testIndexPointsPolygon() throws Exception {
.setQuery(queryBuilder().shapeQuery(defaultFieldName, polygon).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
SearchHits searchHits = searchResponse.getHits();
assertThat(searchHits.getTotalHits().value, equalTo(1L));
assertThat(searchHits.getAt(0).getId(), equalTo("1"));
@@ -223,7 +223,7 @@ public void testIndexPointsMultiPolygon() throws Exception {
.setQuery(queryBuilder().shapeQuery(defaultFieldName, multiPolygon).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(2L));
assertThat(searchResponse.getHits().getHits().length, equalTo(2));
assertThat(searchResponse.getHits().getAt(0).getId(), not(equalTo("2")));
@@ -234,7 +234,7 @@ public void testIndexPointsMultiPolygon() throws Exception {
.setQuery(queryBuilder().shapeQuery(defaultFieldName, multiPolygon).relation(ShapeRelation.WITHIN))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(2L));
assertThat(searchResponse.getHits().getHits().length, equalTo(2));
assertThat(searchResponse.getHits().getAt(0).getId(), not(equalTo("2")));
@@ -245,7 +245,7 @@ public void testIndexPointsMultiPolygon() throws Exception {
.setQuery(queryBuilder().shapeQuery(defaultFieldName, multiPolygon).relation(ShapeRelation.DISJOINT))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("2"));
@@ -255,7 +255,7 @@ public void testIndexPointsMultiPolygon() throws Exception {
.setQuery(queryBuilder().shapeQuery(defaultFieldName, multiPolygon).relation(ShapeRelation.CONTAINS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(0L));
assertThat(searchResponse.getHits().getHits().length, equalTo(0));
}
@@ -283,7 +283,7 @@ public void testIndexPointsRectangle() throws Exception {
.setQuery(queryBuilder().shapeQuery(defaultFieldName, rectangle).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("2"));
@@ -341,7 +341,7 @@ public void testIndexPointsIndexedRectangle() throws Exception {
)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("point2"));
@@ -354,7 +354,7 @@ public void testIndexPointsIndexedRectangle() throws Exception {
.indexedShapePath(indexedShapePath)
)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(0L));
}
@@ -621,7 +621,7 @@ public void testIndexPointsFromLine() throws Exception {
.setTrackTotalHits(true)
.setQuery(queryBuilder().shapeQuery(defaultFieldName, line).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
SearchHits searchHits = searchResponse.getHits();
assertThat(searchHits.getTotalHits().value, equalTo((long) line.length()));
}
@@ -647,7 +647,7 @@ public void testIndexPointsFromPolygon() throws Exception {
.setTrackTotalHits(true)
.setQuery(queryBuilder().shapeQuery(defaultFieldName, polygon).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
SearchHits searchHits = searchResponse.getHits();
assertThat(searchHits.getTotalHits().value, equalTo((long) linearRing.length()));
}
diff --git a/test/framework/src/main/java/org/elasticsearch/search/geo/BaseShapeQueryTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/geo/BaseShapeQueryTestCase.java
index b1319e59e8515..bd8f369e32046 100644
--- a/test/framework/src/main/java/org/elasticsearch/search/geo/BaseShapeQueryTestCase.java
+++ b/test/framework/src/main/java/org/elasticsearch/search/geo/BaseShapeQueryTestCase.java
@@ -43,7 +43,7 @@
import static org.elasticsearch.index.query.QueryBuilders.existsQuery;
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -150,28 +150,28 @@ public void testShapeFetchingPath() throws Exception {
.indexedShapeIndex("shapes")
.indexedShapePath(defaultFieldName);
SearchResponse result = client().prepareSearch(defaultIndexName).setQuery(matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
filter = queryBuilder().shapeQuery(defaultFieldName, "1")
.relation(ShapeRelation.INTERSECTS)
.indexedShapeIndex("shapes")
.indexedShapePath("1.geo");
result = client().prepareSearch(defaultIndexName).setQuery(matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
filter = queryBuilder().shapeQuery(defaultFieldName, "1")
.relation(ShapeRelation.INTERSECTS)
.indexedShapeIndex("shapes")
.indexedShapePath("1.2.geo");
result = client().prepareSearch(defaultIndexName).setQuery(matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
filter = queryBuilder().shapeQuery(defaultFieldName, "1")
.relation(ShapeRelation.INTERSECTS)
.indexedShapeIndex("shapes")
.indexedShapePath("1.2.3.geo");
result = client().prepareSearch(defaultIndexName).setQuery(matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
// now test the query variant
@@ -179,19 +179,19 @@ public void testShapeFetchingPath() throws Exception {
.indexedShapeIndex("shapes")
.indexedShapePath(defaultFieldName);
result = client().prepareSearch(defaultIndexName).setQuery(query).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
query = queryBuilder().shapeQuery(defaultFieldName, "1").indexedShapeIndex("shapes").indexedShapePath("1.geo");
result = client().prepareSearch(defaultIndexName).setQuery(query).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
query = queryBuilder().shapeQuery(defaultFieldName, "1").indexedShapeIndex("shapes").indexedShapePath("1.2.geo");
result = client().prepareSearch(defaultIndexName).setQuery(query).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
query = queryBuilder().shapeQuery(defaultFieldName, "1").indexedShapeIndex("shapes").indexedShapePath("1.2.3.geo");
result = client().prepareSearch(defaultIndexName).setQuery(query).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
}
@@ -220,7 +220,7 @@ public void testRandomGeoCollectionQuery() throws Exception {
QueryBuilder intersects = queryBuilder().intersectionQuery(defaultFieldName, queryCollection);
SearchResponse result = client().prepareSearch(defaultIndexName).setQuery(intersects).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertTrue("query: " + intersects + " doc: " + Strings.toString(docSource), result.getHits().getTotalHits().value > 0);
}
@@ -350,7 +350,7 @@ public void testEdgeCases() throws Exception {
.setQuery(queryBuilder().intersectionQuery(defaultFieldName, query))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("blakely"));
@@ -395,7 +395,7 @@ public void testPointQuery() throws Exception {
SearchResponse result = client().prepareSearch(defaultIndexName)
.setQuery(queryBuilder().intersectionQuery(defaultFieldName, point))
.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
}
@@ -408,7 +408,7 @@ public void testContainsShapeQuery() throws Exception {
client().prepareIndex(defaultIndexName).setId("1").setSource(docSource).setRefreshPolicy(IMMEDIATE).get();
QueryBuilder filter = queryBuilder().shapeQuery(defaultFieldName, innerPolygon).relation(ShapeRelation.CONTAINS);
SearchResponse response = client().prepareSearch(defaultIndexName).setQuery(filter).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(1L));
}
@@ -424,7 +424,7 @@ public void testExistsQuery() throws Exception {
ExistsQueryBuilder eqb = existsQuery(defaultFieldName);
SearchResponse result = client().prepareSearch(defaultIndexName).setQuery(eqb).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
}
@@ -461,7 +461,7 @@ public void testIndexedShapeReference() throws Exception {
.setQuery(queryBuilder().intersectionQuery(defaultFieldName, "Big_Rectangle"))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("1"));
@@ -470,7 +470,7 @@ public void testIndexedShapeReference() throws Exception {
.setQuery(queryBuilder().shapeQuery(defaultFieldName, "Big_Rectangle"))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("1"));
@@ -492,7 +492,7 @@ public void testQueryRandomGeoCollection() throws Exception {
SearchResponse result = client().prepareSearch(defaultIndexName)
.setQuery(queryBuilder().intersectionQuery(defaultFieldName, polygon))
.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
}
@@ -539,26 +539,26 @@ public void testShapeFilterWithDefinedGeoCollection() throws Exception {
{
QueryBuilder filter = queryBuilder().intersectionQuery(defaultFieldName, new GeometryCollection<>(List.of(polygon1)));
SearchResponse result = client().prepareSearch(defaultIndexName).setQuery(matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
}
{
QueryBuilder filter = queryBuilder().intersectionQuery(defaultFieldName, new GeometryCollection<>(List.of(polygon2)));
SearchResponse result = client().prepareSearch(defaultIndexName).setQuery(matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 0);
}
{
QueryBuilder filter = queryBuilder().intersectionQuery(defaultFieldName, new GeometryCollection<>(List.of(polygon1, polygon2)));
SearchResponse result = client().prepareSearch(defaultIndexName).setQuery(matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
}
{
// no shape
QueryBuilder filter = queryBuilder().shapeQuery(defaultFieldName, GeometryCollection.EMPTY);
SearchResponse result = client().prepareSearch(defaultIndexName).setQuery(matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 0);
}
}
@@ -627,7 +627,7 @@ public void testIndexLineQueryPoints() throws Exception {
.setTrackTotalHits(true)
.setQuery(queryBuilder().shapeQuery(defaultFieldName, point).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
SearchHits searchHits = searchResponse.getHits();
assertThat(searchHits.getTotalHits().value, equalTo(1L));
}
@@ -652,7 +652,7 @@ public void testIndexPolygonQueryPoints() throws Exception {
.setTrackTotalHits(true)
.setQuery(queryBuilder().shapeQuery(defaultFieldName, point).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
SearchHits searchHits = searchResponse.getHits();
assertThat(searchHits.getTotalHits().value, equalTo(1L));
}
@@ -685,7 +685,7 @@ public void testNeighbours() throws Exception {
.setTrackTotalHits(true)
.setQuery(queryBuilder().shapeQuery(defaultFieldName, center).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
SearchHits searchHits = searchResponse.getHits();
assertThat(searchHits.getTotalHits().value, equalTo((long) polygons.length));
}
diff --git a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeQueryTestCase.java b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeQueryTestCase.java
index 37ab420849804..b8f5cdf00da34 100644
--- a/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeQueryTestCase.java
+++ b/test/framework/src/main/java/org/elasticsearch/search/geo/GeoShapeQueryTestCase.java
@@ -36,8 +36,7 @@
import java.util.List;
import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCountAndNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
public abstract class GeoShapeQueryTestCase extends BaseShapeQueryTestCase {
@@ -160,11 +159,10 @@ public void testIndexRectangleSpanningDateLine() throws Exception {
Point filterShape = new Point(179, 0);
- SearchResponse result = client().prepareSearch(defaultIndexName)
- .setQuery(queryBuilder().intersectionQuery(defaultFieldName, filterShape))
- .get();
- assertSearchResponse(result);
- assertHitCount(result, 1);
+ assertHitCountAndNoFailures(
+ client().prepareSearch(defaultIndexName).setQuery(queryBuilder().intersectionQuery(defaultFieldName, filterShape)),
+ 1
+ );
}
protected Line makeRandomLine() {
diff --git a/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java b/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java
index 885a1aafd89b8..3379599c381e5 100644
--- a/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java
+++ b/test/framework/src/main/java/org/elasticsearch/test/hamcrest/ElasticsearchAssertions.java
@@ -267,7 +267,7 @@ public static void assertSearchHitsWithoutFailures(SearchRequestBuilder requestB
public static void assertSortValues(SearchRequestBuilder searchRequestBuilder, Object[]... sortValues) {
var searchResponse = searchRequestBuilder.get();
try {
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
SearchHit[] hits = searchResponse.getHits().getHits();
assertEquals(sortValues.length, hits.length);
for (int i = 0; i < sortValues.length; ++i) {
@@ -312,6 +312,16 @@ public static void assertHitCount(SearchResponse countResponse, long expectedHit
}
}
+ public static void assertHitCountAndNoFailures(SearchRequestBuilder searchRequestBuilder, long expectedHitCount) {
+ var res = searchRequestBuilder.get();
+ try {
+ assertHitCount(res, expectedHitCount);
+ assertNoFailures(res);
+ } finally {
+ res.decRef();
+ }
+ }
+
public static void assertExists(GetResponse response) {
String message = String.format(Locale.ROOT, "Expected %s/%s to exist, but does not", response.getIndex(), response.getId());
assertThat(message, response.isExists(), is(true));
@@ -659,23 +669,6 @@ public static void assertFutureThrows(ActionFuture> future, RestStatus status,
assertThat(extraInfo, ExceptionsHelper.status(e), equalTo(status));
}
- /**
- * Applies basic assertions on the SearchResponse. This method checks if all shards were successful, if
- * any of the shards threw an exception and if the response is serializable.
- */
- public static SearchResponse assertSearchResponse(SearchRequestBuilder request) {
- return assertSearchResponse(request.get());
- }
-
- /**
- * Applies basic assertions on the SearchResponse. This method checks if all shards were successful, if
- * any of the shards threw an exception and if the response is serializable.
- */
- public static SearchResponse assertSearchResponse(SearchResponse response) {
- assertNoFailures(response);
- return response;
- }
-
/**
* Check if a file exists
*/
diff --git a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec
index c513f6670b044..49bf62bf77db7 100644
--- a/x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec
+++ b/x-pack/plugin/esql/qa/testFixtures/src/main/resources/where-like.csv-spec
@@ -273,3 +273,17 @@ emp_no:integer | first_name:keyword | last_name:keyword
10086 | Somnath | Foote
10088 | Jungsoon | Syrzycki
;
+
+
+likeWithPath
+row x = "C:\\foo\\bar.exe" | mv_expand x | where x LIKE "C:\\\\*";
+
+x:keyword
+C:\foo\bar.exe
+;
+
+likeWithPathNoMatch
+row x = "C:\\foo\\bar.exe" | mv_expand x | where x LIKE "C:\\\\\\\\*";
+
+x:keyword
+;
diff --git a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/io/stream/PlanNamedTypesTests.java b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/io/stream/PlanNamedTypesTests.java
index 1f92a26f58856..b3da177b1c39c 100644
--- a/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/io/stream/PlanNamedTypesTests.java
+++ b/x-pack/plugin/esql/src/test/java/org/elasticsearch/xpack/esql/io/stream/PlanNamedTypesTests.java
@@ -671,12 +671,13 @@ static Map randomProperties(int depth) {
if (depth > 2) {
return Map.of(); // prevent infinite recursion (between EsField and properties)
}
+ depth += 1;
int size = randomIntBetween(0, 5);
Map map = new HashMap<>();
for (int i = 0; i < size; i++) {
map.put(
randomAlphaOfLength(randomIntBetween(1, 10)), // name
- randomEsField(depth++)
+ randomEsField(depth)
);
}
return Map.copyOf(map);
diff --git a/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongTests.java b/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongTests.java
index 3594dde42229b..727441f5dba10 100644
--- a/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongTests.java
+++ b/x-pack/plugin/mapper-unsigned-long/src/test/java/org/elasticsearch/xpack/unsignedlong/UnsignedLongTests.java
@@ -41,7 +41,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.range;
import static org.elasticsearch.search.aggregations.AggregationBuilders.sum;
import static org.elasticsearch.search.aggregations.AggregationBuilders.terms;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -104,7 +104,7 @@ public void testSort() {
.setSize(numDocs)
.addSort("ul_field", SortOrder.ASC)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SearchHit[] hits = response.getHits().getHits();
assertEquals(hits.length, numDocs);
int i = 0;
@@ -119,7 +119,7 @@ public void testSort() {
.setSize(numDocs)
.addSort("ul_field", SortOrder.DESC)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SearchHit[] hits = response.getHits().getHits();
assertEquals(hits.length, numDocs);
int i = numDocs - 1;
@@ -135,7 +135,7 @@ public void testSort() {
.addSort("ul_field", SortOrder.ASC)
.searchAfter(new Long[] { 100L })
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SearchHit[] hits = response.getHits().getHits();
assertEquals(hits.length, 7);
int i = 3;
@@ -151,7 +151,7 @@ public void testSort() {
.addSort("ul_field", SortOrder.ASC)
.searchAfter(new BigInteger[] { new BigInteger("18446744073709551614") })
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SearchHit[] hits = response.getHits().getHits();
assertEquals(hits.length, 2);
int i = 8;
@@ -167,7 +167,7 @@ public void testSort() {
.addSort("ul_field", SortOrder.ASC)
.searchAfter(new String[] { "18446744073709551614" })
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SearchHit[] hits = response.getHits().getHits();
assertEquals(hits.length, 2);
int i = 8;
@@ -203,7 +203,7 @@ public void testSort() {
.addSort("ul_field", SortOrder.DESC)
.searchAfter(new BigInteger[] { new BigInteger("18446744073709551615") })
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
SearchHit[] hits = response.getHits().getHits();
assertEquals(hits.length, 8);
int i = 7;
@@ -218,7 +218,7 @@ public void testAggs() {
// terms agg
{
SearchResponse response = client().prepareSearch("idx").setSize(0).addAggregation(terms("ul_terms").field("ul_field")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Terms terms = response.getAggregations().get("ul_terms");
long[] expectedBucketDocCounts = { 2, 2, 2, 1, 1, 1, 1 };
@@ -244,7 +244,7 @@ public void testAggs() {
.setSize(0)
.addAggregation(histogram("ul_histo").field("ul_field").interval(9E18).minDocCount(0))
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Histogram histo = response.getAggregations().get("ul_histo");
long[] expectedBucketDocCounts = { 3, 3, 4 };
@@ -265,7 +265,7 @@ public void testAggs() {
range("ul_range").field("ul_field").addUnboundedTo(9.0E18).addRange(9.0E18, 1.8E19).addUnboundedFrom(1.8E19)
)
.get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Range range = response.getAggregations().get("ul_range");
long[] expectedBucketDocCounts = { 3, 3, 4 };
@@ -281,7 +281,7 @@ public void testAggs() {
// sum agg
{
SearchResponse response = client().prepareSearch("idx").setSize(0).addAggregation(sum("ul_sum").field("ul_field")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Sum sum = response.getAggregations().get("ul_sum");
double expectedSum = Arrays.stream(values).mapToDouble(Number::doubleValue).sum();
assertEquals(expectedSum, sum.value(), 0.001);
@@ -289,14 +289,14 @@ public void testAggs() {
// max agg
{
SearchResponse response = client().prepareSearch("idx").setSize(0).addAggregation(max("ul_max").field("ul_field")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Max max = response.getAggregations().get("ul_max");
assertEquals(1.8446744073709551615E19, max.value(), 0.001);
}
// min agg
{
SearchResponse response = client().prepareSearch("idx").setSize(0).addAggregation(min("ul_min").field("ul_field")).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
Min min = response.getAggregations().get("ul_min");
assertEquals(0, min.value(), 0.001);
}
diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/ProcessWorkerExecutorServiceTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/ProcessWorkerExecutorServiceTests.java
index 096d0b7105ce5..6e976a889141f 100644
--- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/ProcessWorkerExecutorServiceTests.java
+++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/job/process/ProcessWorkerExecutorServiceTests.java
@@ -126,6 +126,7 @@ protected void doRun() {
}
}
+ @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/101144")
public void testAutodetectWorkerExecutorServiceDoesNotSwallowErrors() {
ProcessWorkerExecutorService executor = createExecutorService();
if (randomBoolean()) {
diff --git a/x-pack/plugin/profiling/src/internalClusterTest/java/org/elasticsearch/xpack/profiling/GetFlameGraphActionIT.java b/x-pack/plugin/profiling/src/internalClusterTest/java/org/elasticsearch/xpack/profiling/GetFlameGraphActionIT.java
index f0df6c69ba09e..308e377c2826a 100644
--- a/x-pack/plugin/profiling/src/internalClusterTest/java/org/elasticsearch/xpack/profiling/GetFlameGraphActionIT.java
+++ b/x-pack/plugin/profiling/src/internalClusterTest/java/org/elasticsearch/xpack/profiling/GetFlameGraphActionIT.java
@@ -8,6 +8,11 @@
package org.elasticsearch.xpack.profiling;
public class GetFlameGraphActionIT extends ProfilingTestCase {
+ @Override
+ protected boolean useOnlyAllEvents() {
+ return true;
+ }
+
public void testGetStackTracesUnfiltered() throws Exception {
GetStackTracesRequest request = new GetStackTracesRequest(1, null);
GetFlamegraphResponse response = client().execute(GetFlamegraphAction.INSTANCE, request).get();
diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/predicate/regex/RegexMatch.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/predicate/regex/RegexMatch.java
index b7f50100c60db..439bba43b1348 100644
--- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/predicate/regex/RegexMatch.java
+++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/predicate/regex/RegexMatch.java
@@ -7,6 +7,7 @@
package org.elasticsearch.xpack.ql.expression.predicate.regex;
+import org.apache.lucene.util.BytesRef;
import org.elasticsearch.xpack.ql.expression.Expression;
import org.elasticsearch.xpack.ql.expression.Nullability;
import org.elasticsearch.xpack.ql.expression.function.scalar.UnaryScalarFunction;
@@ -69,6 +70,9 @@ public boolean foldable() {
@Override
public Boolean fold() {
Object val = field().fold();
+ if (val instanceof BytesRef br) {
+ val = br.utf8ToString();
+ }
return RegexProcessor.RegexOperation.match(val, pattern().asJavaRegex());
}
diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/util/StringUtils.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/util/StringUtils.java
index db15bfa3c57d5..beebf0d581444 100644
--- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/util/StringUtils.java
+++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/util/StringUtils.java
@@ -139,7 +139,8 @@ public static String likeToJavaPattern(String pattern, char escape) {
// * -> .*
// ? -> .
// escape character - can be 0 (in which case no regex gets escaped) or
- // should be followed by % or _ (otherwise an exception is thrown)
+ // should be followed by * or ? or the escape character itself (otherwise an exception is thrown).
+ // Using * or ? as escape characters should be avoided because it will make it impossible to enter them as literals
public static String wildcardToJavaPattern(String pattern, char escape) {
StringBuilder regex = new StringBuilder(pattern.length() + 4);
@@ -157,7 +158,7 @@ public static String wildcardToJavaPattern(String pattern, char escape) {
case '*' -> regex.append(escaped ? "\\*" : ".*");
case '?' -> regex.append(escaped ? "\\?" : ".");
default -> {
- if (escaped) {
+ if (escaped && escape != curr) {
throw new QlIllegalArgumentException(
"Invalid sequence - escape character is not followed by special wildcard char"
);
diff --git a/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/util/StringUtilsTests.java b/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/util/StringUtilsTests.java
index ca163cff7b36e..3280a96d246a9 100644
--- a/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/util/StringUtilsTests.java
+++ b/x-pack/plugin/ql/src/test/java/org/elasticsearch/xpack/ql/util/StringUtilsTests.java
@@ -52,4 +52,7 @@ public void testWildcard() {
assertEquals("^foo\\*$", wildcardToJavaPattern("foox*", 'x'));
}
+ public void testEscapedEscape() {
+ assertEquals("^\\\\\\\\$", wildcardToJavaPattern("\\\\\\\\", '\\'));
+ }
}
diff --git a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java
index a6ef720e90777..bd39393d7f338 100644
--- a/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java
+++ b/x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java
@@ -70,7 +70,7 @@
import static org.elasticsearch.search.aggregations.AggregationBuilders.dateHistogram;
import static org.elasticsearch.snapshots.SearchableSnapshotsSettings.SEARCHABLE_SNAPSHOT_STORE_TYPE;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshots.SNAPSHOT_RECOVERY_STATE_FACTORY_KEY;
import static org.hamcrest.Matchers.arrayWithSize;
import static org.hamcrest.Matchers.containsString;
@@ -470,7 +470,7 @@ public void testRequestCacheOnFrozen() throws Exception {
dateHistogram("histo").field("f").timeZone(ZoneId.of("+01:00")).minDocCount(0).calendarInterval(DateHistogramInterval.MONTH)
)
.get();
- assertSearchResponse(r1);
+ assertNoFailures(r1);
assertRequestCacheState(client(), "test-index", 0, 1);
@@ -491,7 +491,7 @@ public void testRequestCacheOnFrozen() throws Exception {
.calendarInterval(DateHistogramInterval.MONTH)
)
.get();
- assertSearchResponse(r2);
+ assertNoFailures(r2);
assertRequestCacheState(client(), "test-index", i + 1, 1);
Histogram h1 = r1.getAggregations().get("histo");
Histogram h2 = r2.getAggregations().get("histo");
diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java
index 3baec135d107f..be3162ac98b3b 100644
--- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java
+++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/DocumentLevelSecurityTests.java
@@ -96,7 +96,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHits;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHitsWithoutFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.BASIC_AUTH_HEADER;
import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue;
@@ -541,14 +540,14 @@ public void testPercolateQueryWithIndexedDocWithDLS() {
SearchResponse result = client().filterWithHeader(
Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user1", USERS_PASSWD))
).prepareSearch("query_index").setQuery(new PercolateQueryBuilder("query", "doc_index", "1", null, null, null)).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
// user2 can access the query_index itself (without performing percolate search)
result = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD)))
.prepareSearch("query_index")
.setQuery(QueryBuilders.matchAllQuery())
.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
// user2 cannot access doc#1 of the doc_index so the percolate search fails because doc#1 cannot be found
ResourceNotFoundException e = expectThrows(
@@ -596,14 +595,14 @@ public void testGeoQueryWithIndexedShapeWithDLS() {
requestBuilder.setQuery(shapeQuery);
}
result = requestBuilder.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
// user2 does not have access to doc#1 of the shape_index
result = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user2", USERS_PASSWD)))
.prepareSearch("search_index")
.setQuery(QueryBuilders.matchAllQuery())
.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
IllegalArgumentException e;
if (randomBoolean()) {
diff --git a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java
index 27b6a10e0619c..5d7644efccfe5 100644
--- a/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java
+++ b/x-pack/plugin/security/src/internalClusterTest/java/org/elasticsearch/integration/FieldLevelSecurityTests.java
@@ -82,7 +82,6 @@
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchHitsWithoutFailures;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.BASIC_AUTH_HEADER;
import static org.elasticsearch.xpack.core.security.authc.support.UsernamePasswordToken.basicAuthHeaderValue;
import static org.hamcrest.Matchers.equalTo;
@@ -485,33 +484,33 @@ public void testPercolateQueryWithIndexedDocWithFLS() {
SearchResponse result = client().filterWithHeader(
Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user7", USERS_PASSWD))
).prepareSearch("query_index").setQuery(percolateQuery).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
result = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user3", USERS_PASSWD)))
.prepareSearch("query_index")
.setQuery(QueryBuilders.matchAllQuery())
.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
// user 3 can see the fields of the percolated document, but not the "query" field of the indexed query
result = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user3", USERS_PASSWD)))
.prepareSearch("query_index")
.setQuery(percolateQuery)
.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 0);
result = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user9", USERS_PASSWD)))
.prepareSearch("query_index")
.setQuery(QueryBuilders.matchAllQuery())
.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
// user 9 can see the fields of the index query, but not the field of the indexed document to be percolated
result = client().filterWithHeader(Collections.singletonMap(BASIC_AUTH_HEADER, basicAuthHeaderValue("user9", USERS_PASSWD)))
.prepareSearch("query_index")
.setQuery(percolateQuery)
.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 0);
}
@@ -573,7 +572,7 @@ public void testGeoQueryWithIndexedShapeWithFLS() {
requestBuilder.setQuery(shapeQuery1);
}
result = requestBuilder.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
// user sees the queried point but not the querying shape
final ShapeQueryBuilder shapeQuery2 = new ShapeQueryBuilder("field", "2").relation(ShapeRelation.WITHIN)
@@ -611,7 +610,7 @@ public void testGeoQueryWithIndexedShapeWithFLS() {
requestBuilder.setQuery(shapeQuery3);
}
result = requestBuilder.get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 0);
}
diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeScriptDocValuesIT.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeScriptDocValuesIT.java
index 13a4de7f97fa4..4d526a6a07718 100644
--- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeScriptDocValuesIT.java
+++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/GeoShapeScriptDocValuesIT.java
@@ -51,7 +51,7 @@
import java.util.function.Function;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.greaterThanOrEqualTo;
@@ -268,7 +268,7 @@ private void doTestGeometry(Geometry geometry, GeoShapeValues.GeoShapeValue expe
.addScriptField("label_lat", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "label_lat", Collections.emptyMap()))
.addScriptField("label_lon", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "label_lon", Collections.emptyMap()))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Map fields = searchResponse.getHits().getHits()[0].getFields();
assertThat(fields.get("lat").getValue(), equalTo(value.getY()));
assertThat(fields.get("lon").getValue(), equalTo(value.getX()));
@@ -323,7 +323,7 @@ public void testNullShape() throws Exception {
.addScriptField("height", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "height", Collections.emptyMap()))
.addScriptField("width", new Script(ScriptType.INLINE, CustomScriptPlugin.NAME, "width", Collections.emptyMap()))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
Map fields = searchResponse.getHits().getHits()[0].getFields();
assertThat(fields.get("lat").getValue(), equalTo(Double.NaN));
assertThat(fields.get("lon").getValue(), equalTo(Double.NaN));
diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java
index 8903904eeefd7..a011f42c14518 100644
--- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java
+++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryOverShapeTests.java
@@ -35,7 +35,7 @@
import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertHitCount;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
@@ -176,43 +176,43 @@ public void testShapeFetchingPath() throws Exception {
.indexedShapeIndex(indexName)
.indexedShapePath("location");
SearchResponse result = client().prepareSearch(searchIndex).setQuery(QueryBuilders.matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
filter = new ShapeQueryBuilder("location", "1").relation(ShapeRelation.INTERSECTS)
.indexedShapeIndex(indexName)
.indexedShapePath("1.location");
result = client().prepareSearch(searchIndex).setQuery(QueryBuilders.matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
filter = new ShapeQueryBuilder("location", "1").relation(ShapeRelation.INTERSECTS)
.indexedShapeIndex(indexName)
.indexedShapePath("1.2.location");
result = client().prepareSearch(searchIndex).setQuery(QueryBuilders.matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
filter = new ShapeQueryBuilder("location", "1").relation(ShapeRelation.INTERSECTS)
.indexedShapeIndex(indexName)
.indexedShapePath("1.2.3.location");
result = client().prepareSearch(searchIndex).setQuery(QueryBuilders.matchAllQuery()).setPostFilter(filter).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
// now test the query variant
ShapeQueryBuilder query = new ShapeQueryBuilder("location", "1").indexedShapeIndex(indexName).indexedShapePath("location");
result = client().prepareSearch(searchIndex).setQuery(query).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
query = new ShapeQueryBuilder("location", "1").indexedShapeIndex(indexName).indexedShapePath("1.location");
result = client().prepareSearch(searchIndex).setQuery(query).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
query = new ShapeQueryBuilder("location", "1").indexedShapeIndex(indexName).indexedShapePath("1.2.location");
result = client().prepareSearch(searchIndex).setQuery(query).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
query = new ShapeQueryBuilder("location", "1").indexedShapeIndex(indexName).indexedShapePath("1.2.3.location");
result = client().prepareSearch(searchIndex).setQuery(query).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, 1);
}
@@ -265,7 +265,7 @@ public void testNullShape() {
public void testExistsQuery() {
ExistsQueryBuilder eqb = QueryBuilders.existsQuery(FIELD);
SearchResponse result = client().prepareSearch(INDEX).setQuery(eqb).get();
- assertSearchResponse(result);
+ assertNoFailures(result);
assertHitCount(result, numDocs);
}
@@ -288,7 +288,7 @@ public void testContainsShapeQuery() {
Rectangle rectangle = new Rectangle(-50, 50, 50, -50);
ShapeQueryBuilder queryBuilder = new ShapeQueryBuilder("location", rectangle).relation(ShapeRelation.CONTAINS);
SearchResponse response = client().prepareSearch("test_contains").setQuery(queryBuilder).get();
- assertSearchResponse(response);
+ assertNoFailures(response);
assertThat(response.getHits().getTotalHits().value, equalTo(1L));
}
diff --git a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTestCase.java b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTestCase.java
index 1aad094bfe5b9..8a42e157d0017 100644
--- a/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTestCase.java
+++ b/x-pack/plugin/spatial/src/internalClusterTest/java/org/elasticsearch/xpack/spatial/search/ShapeQueryTestCase.java
@@ -32,7 +32,7 @@
import java.util.List;
import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE;
-import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertSearchResponse;
+import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
import static org.elasticsearch.xcontent.XContentFactory.jsonBuilder;
import static org.hamcrest.Matchers.equalTo;
import static org.hamcrest.Matchers.not;
@@ -87,7 +87,7 @@ public void testIndexPointsFilterRectangle() throws Exception {
.setQuery(new ShapeQueryBuilder(defaultFieldName, rectangle).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("1"));
@@ -95,7 +95,7 @@ public void testIndexPointsFilterRectangle() throws Exception {
// default query, without specifying relation (expect intersects)
searchResponse = client().prepareSearch(defaultIndexName).setQuery(new ShapeQueryBuilder(defaultFieldName, rectangle)).get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("1"));
@@ -124,7 +124,7 @@ public void testIndexPointsCircle() throws Exception {
.setQuery(new ShapeQueryBuilder(defaultFieldName, circle).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("1"));
@@ -153,7 +153,7 @@ public void testIndexPointsPolygon() throws Exception {
.setQuery(new ShapeQueryBuilder(defaultFieldName, polygon).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
SearchHits searchHits = searchResponse.getHits();
assertThat(searchHits.getTotalHits().value, equalTo(1L));
assertThat(searchHits.getAt(0).getId(), equalTo("1"));
@@ -195,7 +195,7 @@ public void testIndexPointsMultiPolygon() throws Exception {
.setQuery(new ShapeQueryBuilder(defaultFieldName, mp).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(2L));
assertThat(searchResponse.getHits().getHits().length, equalTo(2));
assertThat(searchResponse.getHits().getAt(0).getId(), not(equalTo("2")));
@@ -225,7 +225,7 @@ public void testIndexPointsRectangle() throws Exception {
.setQuery(new ShapeQueryBuilder(defaultFieldName, rectangle).relation(ShapeRelation.INTERSECTS))
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("2"));
@@ -283,7 +283,7 @@ public void testIndexPointsIndexedRectangle() throws Exception {
)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L));
assertThat(searchResponse.getHits().getHits().length, equalTo(1));
assertThat(searchResponse.getHits().getAt(0).getId(), equalTo("point2"));
@@ -295,7 +295,7 @@ public void testIndexPointsIndexedRectangle() throws Exception {
.indexedShapePath(indexedShapePath)
)
.get();
- assertSearchResponse(searchResponse);
+ assertNoFailures(searchResponse);
assertThat(searchResponse.getHits().getTotalHits().value, equalTo(0L));
}