diff --git a/server/src/internalClusterTest/java/org/opensearch/action/bulk/BulkWithUpdatesIT.java b/server/src/internalClusterTest/java/org/opensearch/action/bulk/BulkWithUpdatesIT.java index cf091fff03d3e..b9bbb70759163 100644 --- a/server/src/internalClusterTest/java/org/opensearch/action/bulk/BulkWithUpdatesIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/action/bulk/BulkWithUpdatesIT.java @@ -479,7 +479,6 @@ public void testBulkUpdateLargerVolume() throws Exception { assertThat(response.getItems()[i].getId(), equalTo(Integer.toString(i))); assertThat(response.getItems()[i].getVersion(), equalTo(2L)); assertThat(response.getItems()[i].getIndex(), equalTo("test")); - assertThat(response.getItems()[i].getType(), equalTo("type1")); assertThat(response.getItems()[i].getOpType(), equalTo(OpType.UPDATE)); assertThat(response.getItems()[i].getResponse().getId(), equalTo(Integer.toString(i))); assertThat(response.getItems()[i].getResponse().getVersion(), equalTo(2L)); @@ -503,7 +502,6 @@ public void testBulkUpdateLargerVolume() throws Exception { assertThat(response.getItems()[i].getId(), equalTo(Integer.toString(id))); assertThat(response.getItems()[i].getVersion(), equalTo(3L)); assertThat(response.getItems()[i].getIndex(), equalTo("test")); - assertThat(response.getItems()[i].getType(), equalTo("type1")); assertThat(response.getItems()[i].getOpType(), equalTo(OpType.UPDATE)); } } @@ -525,7 +523,6 @@ public void testBulkUpdateLargerVolume() throws Exception { assertThat(response.getItems()[i].getItemId(), equalTo(i)); assertThat(response.getItems()[i].getId(), equalTo(Integer.toString(i))); assertThat(response.getItems()[i].getIndex(), equalTo("test")); - assertThat(response.getItems()[i].getType(), equalTo("type1")); assertThat(response.getItems()[i].getOpType(), equalTo(OpType.UPDATE)); } diff --git a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java index 217c422f9335f..3d61fbeb521f4 100644 --- a/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/gateway/RecoveryFromGatewayIT.java @@ -223,7 +223,7 @@ public void testSingleNodeNoFlush() throws Exception { int numberOfShards = numberOfShards(); assertAcked( prepareCreate("test").setSettings( - Settings.builder().put(SETTING_NUMBER_OF_SHARDS, numberOfShards()).put(SETTING_NUMBER_OF_REPLICAS, randomIntBetween(0, 1)) + Settings.builder().put("index.codec", "Lucene86").put(SETTING_NUMBER_OF_SHARDS, numberOfShards()).put(SETTING_NUMBER_OF_REPLICAS, randomIntBetween(0, 1)) ).addMapping("type1", mapping, XContentType.JSON) ); diff --git a/server/src/internalClusterTest/java/org/opensearch/routing/SimpleRoutingIT.java b/server/src/internalClusterTest/java/org/opensearch/routing/SimpleRoutingIT.java index 99a1eb3361c33..9a481d94e36f7 100644 --- a/server/src/internalClusterTest/java/org/opensearch/routing/SimpleRoutingIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/routing/SimpleRoutingIT.java @@ -425,7 +425,7 @@ public void testRequiredRoutingCrudApis() throws Exception { fail(); } catch (RoutingMissingException e) { assertThat(e.status(), equalTo(RestStatus.BAD_REQUEST)); - assertThat(e.getMessage(), equalTo("routing is required for [test]/[type1]/[1]")); + assertThat(e.getMessage(), equalTo("routing is required for [test]/[1]")); } GetResponse getResponse = client().prepareGet(indexOrAlias(), "1").setRouting(routingValue).execute().actionGet(); assertThat(getResponse.isExists(), equalTo(true)); @@ -440,7 +440,7 @@ public void testRequiredRoutingCrudApis() throws Exception { fail(); } catch (RoutingMissingException e) { assertThat(e.status(), equalTo(RestStatus.BAD_REQUEST)); - assertThat(e.getMessage(), equalTo("routing is required for [test]/[type1]/[1]")); + assertThat(e.getMessage(), equalTo("routing is required for [test]/[1]")); } assertThat(client().prepareGet(indexOrAlias(), "1").setRouting(routingValue).execute().actionGet().isExists(), equalTo(false)); } @@ -509,7 +509,7 @@ public void testRequiredRoutingBulk() throws Exception { assertThat(bulkItemResponse.getOpType(), equalTo(DocWriteRequest.OpType.UPDATE)); assertThat(bulkItemResponse.getFailure().getStatus(), equalTo(RestStatus.BAD_REQUEST)); assertThat(bulkItemResponse.getFailure().getCause(), instanceOf(RoutingMissingException.class)); - assertThat(bulkItemResponse.getFailureMessage(), containsString("routing is required for [test]/[type1]/[1]")); + assertThat(bulkItemResponse.getFailureMessage(), containsString("routing is required for [test]/[1]")); } } @@ -534,7 +534,7 @@ public void testRequiredRoutingBulk() throws Exception { assertThat(bulkItemResponse.getOpType(), equalTo(DocWriteRequest.OpType.DELETE)); assertThat(bulkItemResponse.getFailure().getStatus(), equalTo(RestStatus.BAD_REQUEST)); assertThat(bulkItemResponse.getFailure().getCause(), instanceOf(RoutingMissingException.class)); - assertThat(bulkItemResponse.getFailureMessage(), containsString("routing is required for [test]/[type1]/[1]")); + assertThat(bulkItemResponse.getFailureMessage(), containsString("routing is required for [test]/[1]")); } } @@ -602,7 +602,7 @@ public void testRequiredRoutingMappingVariousAPIs() throws Exception { client().prepareExplain(indexOrAlias(), "type1", "2").setQuery(QueryBuilders.matchAllQuery()).get(); fail(); } catch (RoutingMissingException e) { - assertThat(e.getMessage(), equalTo("routing is required for [test]/[type1]/[2]")); + assertThat(e.getMessage(), equalTo("routing is required for [test]/[2]")); } logger.info("--> verifying term vector with id [1], with routing [0], should succeed"); @@ -614,7 +614,7 @@ public void testRequiredRoutingMappingVariousAPIs() throws Exception { client().prepareTermVectors(indexOrAlias(), "1").get(); fail(); } catch (RoutingMissingException e) { - assertThat(e.getMessage(), equalTo("routing is required for [test]/[_doc]/[1]")); + assertThat(e.getMessage(), equalTo("routing is required for [test]/[1]")); } UpdateResponse updateResponse = client().prepareUpdate(indexOrAlias(), "type1", "1") @@ -628,7 +628,7 @@ public void testRequiredRoutingMappingVariousAPIs() throws Exception { client().prepareUpdate(indexOrAlias(), "type1", "1").setDoc(Requests.INDEX_CONTENT_TYPE, "field1", "value1").get(); fail(); } catch (RoutingMissingException e) { - assertThat(e.getMessage(), equalTo("routing is required for [test]/[type1]/[1]")); + assertThat(e.getMessage(), equalTo("routing is required for [test]/[1]")); } logger.info("--> verifying mget with ids [1,2], with routing [0], should succeed"); @@ -650,10 +650,10 @@ public void testRequiredRoutingMappingVariousAPIs() throws Exception { assertThat(multiGetResponse.getResponses().length, equalTo(2)); assertThat(multiGetResponse.getResponses()[0].isFailed(), equalTo(true)); assertThat(multiGetResponse.getResponses()[0].getFailure().getId(), equalTo("1")); - assertThat(multiGetResponse.getResponses()[0].getFailure().getMessage(), equalTo("routing is required for [test]/[type1]/[1]")); + assertThat(multiGetResponse.getResponses()[0].getFailure().getMessage(), equalTo("routing is required for [test]/[1]")); assertThat(multiGetResponse.getResponses()[1].isFailed(), equalTo(true)); assertThat(multiGetResponse.getResponses()[1].getFailure().getId(), equalTo("2")); - assertThat(multiGetResponse.getResponses()[1].getFailure().getMessage(), equalTo("routing is required for [test]/[type1]/[2]")); + assertThat(multiGetResponse.getResponses()[1].getFailure().getMessage(), equalTo("routing is required for [test]/[2]")); MultiTermVectorsResponse multiTermVectorsResponse = client().prepareMultiTermVectors() .add(new TermVectorsRequest(indexOrAlias(), "1").routing(routingValue)) @@ -678,7 +678,7 @@ public void testRequiredRoutingMappingVariousAPIs() throws Exception { assertThat(multiTermVectorsResponse.getResponses()[0].isFailed(), equalTo(true)); assertThat( multiTermVectorsResponse.getResponses()[0].getFailure().getCause().getMessage(), - equalTo("routing is required for [test]/[_doc]/[1]") + equalTo("routing is required for [test]/[1]") ); assertThat(multiTermVectorsResponse.getResponses()[0].getResponse(), nullValue()); assertThat(multiTermVectorsResponse.getResponses()[1].getId(), equalTo("2")); @@ -686,7 +686,7 @@ public void testRequiredRoutingMappingVariousAPIs() throws Exception { assertThat(multiTermVectorsResponse.getResponses()[1].getResponse(), nullValue()); assertThat( multiTermVectorsResponse.getResponses()[1].getFailure().getCause().getMessage(), - equalTo("routing is required for [test]/[_doc]/[2]") + equalTo("routing is required for [test]/[2]") ); } diff --git a/server/src/internalClusterTest/java/org/opensearch/update/UpdateIT.java b/server/src/internalClusterTest/java/org/opensearch/update/UpdateIT.java index 78fe10e292515..3799d3325dc97 100644 --- a/server/src/internalClusterTest/java/org/opensearch/update/UpdateIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/update/UpdateIT.java @@ -593,7 +593,6 @@ public void testContextVariables() throws Exception { getResponse = client().prepareGet("test", "id2").execute().actionGet(); updateContext = (Map) getResponse.getSourceAsMap().get("update_context"); assertEquals("test", updateContext.get("_index")); - assertEquals("type1", updateContext.get("_type")); assertEquals("id2", updateContext.get("_id")); assertEquals(1, updateContext.get("_version")); assertNull(updateContext.get("_routing"));