diff --git a/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java b/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java index 1798bb80b6bea..8d23bf78731f9 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/nested/SimpleNestedIT.java @@ -200,7 +200,7 @@ public void testMultiNested() throws Exception { assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L)); searchResponse = client().prepareSearch("test").setQuery(nestedQuery("nested1.nested2", - termQuery("nested1.nested2.field2", "2"), ScoreMode.Avg)).get(); + termQuery("nested1.nested2.field2", "2"), ScoreMode.Avg)).get(); assertNoFailures(searchResponse); assertThat(searchResponse.getHits().getTotalHits().value, equalTo(1L)); @@ -552,16 +552,16 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { + " {\n" + " \"name\": \"read\",\n" + " \"user\": [\n" - + " {\"username\": \"matt\", \"id\": 1},\n" - + " {\"username\": \"fred\", \"id\": 2},\n" - + " {\"username\": \"adrien\", \"id\": 3}\n" + + " {\"username\": \"grault\", \"id\": 1},\n" + + " {\"username\": \"quxx\", \"id\": 2},\n" + + " {\"username\": \"bar\", \"id\": 3}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"write\",\n" + " \"user\": [\n" - + " {\"username\": \"fred\", \"id\": 2},\n" - + " {\"username\": \"adrien\", \"id\": 3}\n" + + " {\"username\": \"quxx\", \"id\": 2},\n" + + " {\"username\": \"bar\", \"id\": 3}\n" + " ]\n" + " }\n" + " ]\n" @@ -572,20 +572,20 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { + " {\n" + " \"name\": \"read\",\n" + " \"user\": [\n" - + " {\"username\": \"jim\", \"id\": 4},\n" - + " {\"username\": \"fred\", \"id\": 2}\n" + + " {\"username\": \"baz\", \"id\": 4},\n" + + " {\"username\": \"quxx\", \"id\": 2}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"write\",\n" + " \"user\": [\n" - + " {\"username\": \"fred\", \"id\": 2}\n" + + " {\"username\": \"quxx\", \"id\": 2}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"execute\",\n" + " \"user\": [\n" - + " {\"username\": \"fred\", \"id\": 2}\n" + + " {\"username\": \"quxx\", \"id\": 2}\n" + " ]\n" + " }\n" + " ]\n" @@ -601,14 +601,14 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { + " {\n" + " \"name\": \"read\",\n" + " \"user\": [\n" - + " {\"username\": \"matt\", \"id\": 1},\n" - + " {\"username\": \"quxx\", \"id\": 5}\n" + + " {\"username\": \"grault\", \"id\": 1},\n" + + " {\"username\": \"foo\", \"id\": 5}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"execute\",\n" + " \"user\": [\n" - + " {\"username\": \"quxx\", \"id\": 5}\n" + + " {\"username\": \"foo\", \"id\": 5}\n" + " ]\n" + " }\n" + " ]\n" @@ -619,19 +619,19 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { + " {\n" + " \"name\": \"read\",\n" + " \"user\": [\n" - + " {\"username\": \"matt\", \"id\": 1}\n" + + " {\"username\": \"grault\", \"id\": 1}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"write\",\n" + " \"user\": [\n" - + " {\"username\": \"matt\", \"id\": 1}\n" + + " {\"username\": \"grault\", \"id\": 1}\n" + " ]\n" + " },\n" + " {\n" + " \"name\": \"execute\",\n" + " \"user\": [\n" - + " {\"username\": \"matt\", \"id\": 1}\n" + + " {\"username\": \"grault\", \"id\": 1}\n" + " ]\n" + " }\n" + " ]\n" @@ -640,7 +640,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { + "}", XContentType.JSON).get(); refresh(); - // access id = 1, read, max value, asc, should use matt and fred + // access id = 1, read, max value, asc, should use grault and quxx SearchResponse searchResponse = client().prepareSearch() .setQuery(matchAllQuery()) .addSort( @@ -658,12 +658,12 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { assertHitCount(searchResponse, 2); assertThat(searchResponse.getHits().getHits().length, equalTo(2)); assertThat(searchResponse.getHits().getHits()[0].getId(), equalTo("2")); - assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("matt")); + assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("grault")); assertThat(searchResponse.getHits().getHits()[1].getId(), equalTo("1")); - assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("fred")); + assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("quxx")); - // access id = 1, read, min value, asc, should now use adrien and quxx + // access id = 1, read, min value, asc, should now use bar and foo searchResponse = client().prepareSearch() .setQuery(matchAllQuery()) .addSort( @@ -681,11 +681,11 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { assertHitCount(searchResponse, 2); assertThat(searchResponse.getHits().getHits().length, equalTo(2)); assertThat(searchResponse.getHits().getHits()[0].getId(), equalTo("1")); - assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("adrien")); + assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("bar")); assertThat(searchResponse.getHits().getHits()[1].getId(), equalTo("2")); - assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("quxx")); + assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("foo")); - // execute, by matt or quxx, by user id, sort missing first + // execute, by grault or foo, by user id, sort missing first searchResponse = client().prepareSearch() .setQuery(matchAllQuery()) .addSort( @@ -694,7 +694,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { .setNestedSort(new NestedSortBuilder("acl.operation") .setFilter(QueryBuilders.termQuery("acl.operation.name", "execute")) .setNestedSort(new NestedSortBuilder("acl.operation.user") - .setFilter(QueryBuilders.termsQuery("acl.operation.user.username", "matt", "quxx"))))) + .setFilter(QueryBuilders.termsQuery("acl.operation.user.username", "grault", "foo"))))) .missing("_first") .sortMode(SortMode.MIN) .order(SortOrder.DESC) @@ -707,7 +707,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { assertThat(searchResponse.getHits().getHits()[1].getId(), equalTo("2")); assertThat(searchResponse.getHits().getHits()[1].getSortValues()[0].toString(), equalTo("1")); - // execute, by matt or luca, by username, sort missing last (default) + // execute, by grault or foo, by username, sort missing last (default) searchResponse = client().prepareSearch() .setQuery(matchAllQuery()) .addSort( @@ -716,7 +716,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { .setNestedSort(new NestedSortBuilder("acl.operation") .setFilter(QueryBuilders.termQuery("acl.operation.name", "execute")) .setNestedSort(new NestedSortBuilder("acl.operation.user") - .setFilter(QueryBuilders.termsQuery("acl.operation.user.username", "matt", "quxx"))))) + .setFilter(QueryBuilders.termsQuery("acl.operation.user.username", "grault", "foo"))))) .sortMode(SortMode.MIN) .order(SortOrder.DESC) ) @@ -725,7 +725,7 @@ public void testNestedSortWithMultiLevelFiltering() throws Exception { assertHitCount(searchResponse, 2); assertThat(searchResponse.getHits().getHits().length, equalTo(2)); assertThat(searchResponse.getHits().getHits()[0].getId(), equalTo("2")); - assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("quxx")); + assertThat(searchResponse.getHits().getHits()[0].getSortValues()[0].toString(), equalTo("foo")); assertThat(searchResponse.getHits().getHits()[1].getId(), equalTo("1")); // missing last } diff --git a/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java b/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java index 271612fcbcd5b..756fe59ddc33a 100644 --- a/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/search/query/SearchQueryIT.java @@ -924,7 +924,7 @@ public void testFuzzyQueryString() { client().prepareIndex("test", "type1", "2").setSource("str", "fred", "date", "2012-02-05", "num", 20).get(); refresh(); - SearchResponse searchResponse = client().prepareSearch().setQuery(queryStringQuery("str:kimcy~1")).get(); + SearchResponse searchResponse = client().prepareSearch().setQuery(queryStringQuery("str:foobaz~1")).get(); assertNoFailures(searchResponse); assertHitCount(searchResponse, 1L); assertFirstHit(searchResponse, hasId("1")); diff --git a/server/src/test/java/org/opensearch/OpenSearchExceptionTests.java b/server/src/test/java/org/opensearch/OpenSearchExceptionTests.java index 722484dc7ec2e..022a2a2c63ab3 100644 --- a/server/src/test/java/org/opensearch/OpenSearchExceptionTests.java +++ b/server/src/test/java/org/opensearch/OpenSearchExceptionTests.java @@ -230,7 +230,7 @@ public void testDeduplicate() throws IOException { "\"phase\":\"search\",\"grouped\":true,\"failed_shards\":[{\"shard\":1,\"index\":\"foo\",\"node\":\"node_1\"," + "\"reason\":{\"type\":\"parsing_exception\",\"reason\":\"foobar\",\"line\":1,\"col\":2}},{\"shard\":1," + "\"index\":\"foo1\",\"node\":\"node_1\",\"reason\":{\"type\":\"query_shard_exception\",\"reason\":\"foobar\"," + - "\"index_uuid\":\"_na_\",\"index\":\"foo1\"}}]}"; + "\"index\":\"foo1\",\"index_uuid\":\"_na_\"}}]}"; assertEquals(expected, Strings.toString(builder)); } { diff --git a/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java b/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java index 9831843774ebc..f799e8953d972 100644 --- a/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java +++ b/server/src/test/java/org/opensearch/action/search/SearchPhaseExecutionExceptionTests.java @@ -82,9 +82,9 @@ public void testToXContent() throws IOException { + " \"reason\": {" + " \"type\": \"index_shard_closed_exception\"," + " \"reason\": \"CurrentState[CLOSED] Closed\"," - + " \"index_uuid\": \"_na_\"," + + " \"index\": \"foo\"," + " \"shard\": \"1\"," - + " \"index\": \"foo\"" + + " \"index_uuid\": \"_na_\"" + " }" + " }" + " ]" diff --git a/server/src/test/java/org/opensearch/rest/action/RestActionsTests.java b/server/src/test/java/org/opensearch/rest/action/RestActionsTests.java index 9203c20cc2ed5..01bfefe632d31 100644 --- a/server/src/test/java/org/opensearch/rest/action/RestActionsTests.java +++ b/server/src/test/java/org/opensearch/rest/action/RestActionsTests.java @@ -141,8 +141,8 @@ public void testBuildBroadcastShardsHeader() throws IOException { " \"reason\" : {\n" + " \"type\" : \"parsing_exception\",\n" + " \"reason\" : \"error\",\n" + - " \"index_uuid\" : \"_na_\",\n" + " \"index\" : \"index\",\n" + + " \"index_uuid\" : \"_na_\",\n" + " \"line\" : 0,\n" + " \"col\" : 0,\n" + " \"caused_by\" : {\n" + @@ -158,8 +158,8 @@ public void testBuildBroadcastShardsHeader() throws IOException { " \"reason\" : {\n" + " \"type\" : \"parsing_exception\",\n" + " \"reason\" : \"error\",\n" + - " \"index_uuid\" : \"_na_\",\n" + " \"index\" : \"index\",\n" + + " \"index_uuid\" : \"_na_\",\n" + " \"line\" : 0,\n" + " \"col\" : 0,\n" + " \"caused_by\" : {\n" + @@ -175,8 +175,8 @@ public void testBuildBroadcastShardsHeader() throws IOException { " \"reason\" : {\n" + " \"type\" : \"parsing_exception\",\n" + " \"reason\" : \"error\",\n" + - " \"index_uuid\" : \"_na_\",\n" + " \"index\" : \"index\",\n" + + " \"index_uuid\" : \"_na_\",\n" + " \"line\" : 0,\n" + " \"col\" : 0,\n" + " \"caused_by\" : {\n" + diff --git a/server/src/test/resources/org/opensearch/plugins/dummy-plugin.jar b/server/src/test/resources/org/opensearch/plugins/dummy-plugin.jar index 4f7d81df4fa30..f90f71cea2891 100644 Binary files a/server/src/test/resources/org/opensearch/plugins/dummy-plugin.jar and b/server/src/test/resources/org/opensearch/plugins/dummy-plugin.jar differ diff --git a/server/src/test/resources/org/opensearch/plugins/non-extensible-plugin.jar b/server/src/test/resources/org/opensearch/plugins/non-extensible-plugin.jar index 54d330349eda2..3ef903e030d8c 100644 Binary files a/server/src/test/resources/org/opensearch/plugins/non-extensible-plugin.jar and b/server/src/test/resources/org/opensearch/plugins/non-extensible-plugin.jar differ