diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/CrudIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/CrudIT.java index 048e2060bb8..d26a7170134 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/CrudIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/CrudIT.java @@ -70,11 +70,7 @@ import org.opensearch.index.VersionType; import org.opensearch.index.get.GetResult; import org.opensearch.rest.RestStatus; import org.opensearch.rest.action.document.RestBulkAction; -import org.opensearch.rest.action.document.RestDeleteAction; -import org.opensearch.rest.action.document.RestGetAction; -import org.opensearch.rest.action.document.RestIndexAction; import org.opensearch.rest.action.document.RestMultiGetAction; -import org.opensearch.rest.action.document.RestUpdateAction; import org.opensearch.script.Script; import org.opensearch.script.ScriptType; import org.opensearch.search.fetch.subphase.FetchSourceContext; @@ -206,31 +202,6 @@ public class CrudIT extends OpenSearchRestHighLevelClientTestCase { } } - public void testDeleteWithTypes() throws IOException { - String docId = "id"; - IndexRequest indexRequest = new IndexRequest("index", "type", docId); - indexRequest.source(Collections.singletonMap("foo", "bar")); - execute( - indexRequest, - highLevelClient()::index, - highLevelClient()::indexAsync, - expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE) - ); - - DeleteRequest deleteRequest = new DeleteRequest("index", "type", docId); - DeleteResponse deleteResponse = execute( - deleteRequest, - highLevelClient()::delete, - highLevelClient()::deleteAsync, - expectWarningsOnce(RestDeleteAction.TYPES_DEPRECATION_MESSAGE) - ); - - assertEquals("index", deleteResponse.getIndex()); - assertEquals("type", deleteResponse.getType()); - assertEquals(docId, deleteResponse.getId()); - assertEquals(DocWriteResponse.Result.DELETED, deleteResponse.getResult()); - } - public void testExists() throws IOException { { GetRequest getRequest = new GetRequest("index", "id"); @@ -416,36 +387,6 @@ public class CrudIT extends OpenSearchRestHighLevelClientTestCase { } } - public void testGetWithTypes() throws IOException { - String document = "{\"field\":\"value\"}"; - IndexRequest indexRequest = new IndexRequest("index", "type", "id"); - indexRequest.source(document, XContentType.JSON); - indexRequest.setRefreshPolicy(RefreshPolicy.IMMEDIATE); - execute( - indexRequest, - highLevelClient()::index, - highLevelClient()::indexAsync, - expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE) - ); - - GetRequest getRequest = new GetRequest("index", "type", "id"); - GetResponse getResponse = execute( - getRequest, - highLevelClient()::get, - highLevelClient()::getAsync, - expectWarningsOnce(RestGetAction.TYPES_DEPRECATION_MESSAGE) - ); - - assertEquals("index", getResponse.getIndex()); - assertEquals("type", getResponse.getType()); - assertEquals("id", getResponse.getId()); - - assertTrue(getResponse.isExists()); - assertFalse(getResponse.isSourceEmpty()); - assertEquals(1L, getResponse.getVersion()); - assertEquals(document, getResponse.getSourceAsString()); - } - public void testMultiGet() throws IOException { { MultiGetRequest multiGetRequest = new MultiGetRequest(); @@ -739,22 +680,6 @@ public class CrudIT extends OpenSearchRestHighLevelClientTestCase { } } - public void testIndexWithTypes() throws IOException { - final XContentType xContentType = randomFrom(XContentType.values()); - IndexRequest indexRequest = new IndexRequest("index", "some_type", "some_id"); - indexRequest.source(XContentBuilder.builder(xContentType.xContent()).startObject().field("test", "test").endObject()); - IndexResponse indexResponse = execute( - indexRequest, - highLevelClient()::index, - highLevelClient()::indexAsync, - expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE) - ); - assertEquals(RestStatus.CREATED, indexResponse.status()); - assertEquals("index", indexResponse.getIndex()); - assertEquals("some_type", indexResponse.getType()); - assertEquals("some_id", indexResponse.getId()); - } - public void testUpdate() throws IOException { { UpdateRequest updateRequest = new UpdateRequest("index", "does_not_exist"); @@ -955,29 +880,6 @@ public class CrudIT extends OpenSearchRestHighLevelClientTestCase { } } - public void testUpdateWithTypes() throws IOException { - IndexRequest indexRequest = new IndexRequest("index", "type", "id"); - indexRequest.source(singletonMap("field", "value")); - IndexResponse indexResponse = execute( - indexRequest, - highLevelClient()::index, - highLevelClient()::indexAsync, - expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE) - ); - - UpdateRequest updateRequest = new UpdateRequest("index", "type", "id"); - updateRequest.doc(singletonMap("field", "updated"), randomFrom(XContentType.values())); - UpdateResponse updateResponse = execute( - updateRequest, - highLevelClient()::update, - highLevelClient()::updateAsync, - expectWarningsOnce(RestUpdateAction.TYPES_DEPRECATION_MESSAGE) - ); - - assertEquals(RestStatus.OK, updateResponse.status()); - assertEquals(indexResponse.getVersion() + 1, updateResponse.getVersion()); - } - public void testBulk() throws IOException { int nbItems = randomIntBetween(10, 100); boolean[] errors = new boolean[nbItems]; diff --git a/client/rest-high-level/src/test/java/org/opensearch/client/SearchIT.java b/client/rest-high-level/src/test/java/org/opensearch/client/SearchIT.java index 22ff3aebae9..60c984ad2cc 100644 --- a/client/rest-high-level/src/test/java/org/opensearch/client/SearchIT.java +++ b/client/rest-high-level/src/test/java/org/opensearch/client/SearchIT.java @@ -64,7 +64,6 @@ import org.opensearch.index.query.TermsQueryBuilder; import org.opensearch.join.aggregations.Children; import org.opensearch.join.aggregations.ChildrenAggregationBuilder; import org.opensearch.rest.RestStatus; -import org.opensearch.rest.action.document.RestIndexAction; import org.opensearch.script.Script; import org.opensearch.script.ScriptType; import org.opensearch.script.mustache.MultiSearchTemplateRequest; @@ -125,24 +124,19 @@ public class SearchIT extends OpenSearchRestHighLevelClientTestCase { @Before public void indexDocuments() throws IOException { { - Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/type/1"); - doc1.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE)); + Request doc1 = new Request(HttpPut.METHOD_NAME, "/index/_doc/1"); doc1.setJsonEntity("{\"type\":\"type1\", \"id\":1, \"num\":10, \"num2\":50}"); client().performRequest(doc1); - Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/type/2"); - doc2.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE)); + Request doc2 = new Request(HttpPut.METHOD_NAME, "/index/_doc/2"); doc2.setJsonEntity("{\"type\":\"type1\", \"id\":2, \"num\":20, \"num2\":40}"); client().performRequest(doc2); - Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/type/3"); - doc3.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE)); + Request doc3 = new Request(HttpPut.METHOD_NAME, "/index/_doc/3"); doc3.setJsonEntity("{\"type\":\"type1\", \"id\":3, \"num\":50, \"num2\":35}"); client().performRequest(doc3); - Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/type/4"); - doc4.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE)); + Request doc4 = new Request(HttpPut.METHOD_NAME, "/index/_doc/4"); doc4.setJsonEntity("{\"type\":\"type2\", \"id\":4, \"num\":100, \"num2\":10}"); client().performRequest(doc4); - Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/type/5"); - doc5.setOptions(expectWarningsOnce(RestIndexAction.TYPES_DEPRECATION_MESSAGE)); + Request doc5 = new Request(HttpPut.METHOD_NAME, "/index/_doc/5"); doc5.setJsonEntity("{\"type\":\"type2\", \"id\":5, \"num\":100, \"num2\":10}"); client().performRequest(doc5); } @@ -241,13 +235,11 @@ public class SearchIT extends OpenSearchRestHighLevelClientTestCase { assertEquals(5, searchResponse.getHits().getHits().length); for (SearchHit searchHit : searchResponse.getHits().getHits()) { assertEquals("index", searchHit.getIndex()); - assertEquals("type", searchHit.getType()); assertThat(Integer.valueOf(searchHit.getId()), both(greaterThan(0)).and(lessThan(6))); assertEquals(1.0f, searchHit.getScore(), 0); assertEquals(-1L, searchHit.getVersion()); assertNotNull(searchHit.getSourceAsMap()); assertEquals(4, searchHit.getSourceAsMap().size()); - assertTrue(searchHit.getSourceAsMap().containsKey("type")); assertTrue(searchHit.getSourceAsMap().containsKey("num")); assertTrue(searchHit.getSourceAsMap().containsKey("num2")); } @@ -266,7 +258,6 @@ public class SearchIT extends OpenSearchRestHighLevelClientTestCase { assertThat(searchResponse.getHits().getMaxScore(), greaterThan(0f)); SearchHit searchHit = searchResponse.getHits().getHits()[0]; assertEquals("index", searchHit.getIndex()); - assertEquals("type", searchHit.getType()); assertEquals("1", searchHit.getId()); assertThat(searchHit.getScore(), greaterThan(0f)); assertEquals(-1L, searchHit.getVersion()); diff --git a/distribution/archives/integ-test-zip/src/test/java/org/opensearch/test/rest/RequestsWithoutContentIT.java b/distribution/archives/integ-test-zip/src/test/java/org/opensearch/test/rest/RequestsWithoutContentIT.java index 474f7052b84..92c35ccf316 100644 --- a/distribution/archives/integ-test-zip/src/test/java/org/opensearch/test/rest/RequestsWithoutContentIT.java +++ b/distribution/archives/integ-test-zip/src/test/java/org/opensearch/test/rest/RequestsWithoutContentIT.java @@ -43,7 +43,7 @@ public class RequestsWithoutContentIT extends OpenSearchRestTestCase { public void testIndexMissingBody() throws IOException { ResponseException responseException = expectThrows(ResponseException.class, () -> - client().performRequest(new Request(randomBoolean() ? "POST" : "PUT", "/idx/type/123"))); + client().performRequest(new Request(randomBoolean() ? "POST" : "PUT", "/idx/_doc/123"))); assertResponseException(responseException, "request body is required"); } diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/200_dissect_processor.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/200_dissect_processor.yml index 709d4b9e62d..916a7fe656c 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/200_dissect_processor.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/200_dissect_processor.yml @@ -62,7 +62,6 @@ teardown: catch: '/Unable to find match for dissect pattern: \%\{a\},\%\{b\},\%\{c\} against source: foo bar baz/' index: index: test - type: test id: 2 pipeline: "my_pipeline" body: {message: "foo bar baz"} diff --git a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/80_foreach.yml b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/80_foreach.yml index 7fbf182eac0..9142317ce15 100644 --- a/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/80_foreach.yml +++ b/modules/ingest-common/src/yamlRestTest/resources/rest-api-spec/test/ingest/80_foreach.yml @@ -31,7 +31,6 @@ teardown: - do: index: index: test - type: test id: 1 pipeline: "my_pipeline" body: > @@ -42,7 +41,6 @@ teardown: - do: get: index: test - type: test id: 1 - match: { _source.values: ["FOO", "BAR", "BAZ"] } diff --git a/qa/full-cluster-restart/src/test/java/org/opensearch/upgrades/FullClusterRestartIT.java b/qa/full-cluster-restart/src/test/java/org/opensearch/upgrades/FullClusterRestartIT.java index b2e01304898..ee903dc0f2e 100644 --- a/qa/full-cluster-restart/src/test/java/org/opensearch/upgrades/FullClusterRestartIT.java +++ b/qa/full-cluster-restart/src/test/java/org/opensearch/upgrades/FullClusterRestartIT.java @@ -50,7 +50,6 @@ import org.opensearch.common.xcontent.json.JsonXContent; import org.opensearch.common.xcontent.support.XContentMapValues; import org.opensearch.index.IndexSettings; import org.opensearch.rest.action.document.RestBulkAction; -import org.opensearch.rest.action.document.RestIndexAction; import org.opensearch.rest.action.document.RestUpdateAction; import org.opensearch.rest.action.search.RestExplainAction; import org.opensearch.test.NotEqualMessageBuilder; @@ -989,9 +988,6 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase { for (int i = 0; i < numDocs; i++) { String doc = Strings.toString(JsonXContent.contentBuilder().startObject().field("field", "v1").endObject()); Request request = new Request("POST", "/" + index + "/" + type + "/" + i); - if (isRunningAgainstAncientCluster() == false) { - request.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE)); - } request.setJsonEntity(doc); client().performRequest(request); refresh(); @@ -1258,9 +1254,6 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase { Request request = new Request("PUT", "/info/" + this.type + "/" + index + "_" + type); request.addParameter("op_type", "create"); request.setJsonEntity(Strings.toString(infoDoc)); - if (isRunningAgainstAncientCluster() == false) { - request.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE)); - } client().performRequest(request); } @@ -1516,11 +1509,7 @@ public class FullClusterRestartIT extends AbstractFullClusterRestartTestCase { Request bulk = new Request("POST", "/_bulk"); bulk.addParameter("refresh", "true"); - bulk.setJsonEntity("{\"index\": {\"_index\": \"test_index_old\", \"_type\" : \"" + type + "\"}}\n" + - "{\"f1\": \"v1\", \"f2\": \"v2\"}\n"); - if (isRunningAgainstAncientCluster() == false) { - bulk.setOptions(expectWarnings(RestBulkAction.TYPES_DEPRECATION_MESSAGE)); - } + bulk.setJsonEntity("{\"index\": {\"_index\": \"test_index_old\"}}\n" + "{\"f1\": \"v1\", \"f2\": \"v2\"}\n"); client().performRequest(bulk); // start a async reindex job diff --git a/qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java b/qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java index 64f3114f1d8..a0c8e8b9a03 100644 --- a/qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java +++ b/qa/mixed-cluster/src/test/java/org/opensearch/backwards/IndexingIT.java @@ -67,9 +67,8 @@ public class IndexingIT extends OpenSearchRestTestCase { private int indexDocs(String index, final int idStart, final int numDocs) throws IOException { for (int i = 0; i < numDocs; i++) { final int id = idStart + i; - Request request = new Request("PUT", index + "/doc/" + id); + Request request = new Request("PUT", index + "/_doc/" + id); request.setJsonEntity("{\"test\": \"test_" + randomAlphaOfLength(2) + "\"}"); - request.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE)); assertOK(client().performRequest(request)); } return numDocs; @@ -364,7 +363,7 @@ public class IndexingIT extends OpenSearchRestTestCase { } private void assertVersion(final String index, final int docId, final String preference, final int expectedVersion) throws IOException { - Request request = new Request("GET", index + "/doc/" + docId); + Request request = new Request("GET", index + "/_doc/" + docId); request.addParameter("preference", preference); request.setOptions(expectWarnings(RestGetAction.TYPES_DEPRECATION_MESSAGE)); diff --git a/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/RecoveryIT.java b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/RecoveryIT.java index 5870ec171ae..41af456d3c4 100644 --- a/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/RecoveryIT.java +++ b/qa/rolling-upgrade/src/test/java/org/opensearch/upgrades/RecoveryIT.java @@ -123,9 +123,8 @@ public class RecoveryIT extends AbstractRollingTestCase { private int indexDocs(String index, final int idStart, final int numDocs) throws IOException { for (int i = 0; i < numDocs; i++) { final int id = idStart + i; - Request indexDoc = new Request("PUT", index + "/test/" + id); + Request indexDoc = new Request("PUT", index + "/_doc/" + id); indexDoc.setJsonEntity("{\"test\": \"test_" + randomAsciiOfLength(2) + "\"}"); - indexDoc.setOptions(expectWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE)); client().performRequest(indexDoc); } return numDocs; @@ -659,7 +658,7 @@ public class RecoveryIT extends AbstractRollingTestCase { final int times = randomIntBetween(0, 2); for (int i = 0; i < times; i++) { long value = randomNonNegativeLong(); - Request update = new Request("POST", index + "/test/" + docId + "/_update"); + Request update = new Request("POST", index + "/_update/" + docId); update.setOptions(expectWarnings(RestUpdateAction.TYPES_DEPRECATION_MESSAGE)); update.setJsonEntity("{\"doc\": {\"updated_field\": " + value + "}}"); client().performRequest(update); @@ -668,7 +667,7 @@ public class RecoveryIT extends AbstractRollingTestCase { } client().performRequest(new Request("POST", index + "/_refresh")); for (int docId : updates.keySet()) { - Request get = new Request("GET", index + "/test/" + docId); + Request get = new Request("GET", index + "/_doc/" + docId); get.setOptions(expectWarnings(RestGetAction.TYPES_DEPRECATION_MESSAGE)); Map doc = entityAsMap(client().performRequest(get)); assertThat(XContentMapValues.extractValue("_source.updated_field", doc), equalTo(updates.get(docId))); diff --git a/qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml b/qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml index 5a3f64151f4..b70ad87387d 100644 --- a/qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml +++ b/qa/smoke-test-ingest-disabled/src/test/resources/rest-api-spec/test/ingest_mustache/10_ingest_disabled.yml @@ -74,7 +74,6 @@ catch: /There are no ingest nodes in this cluster, unable to forward request to an ingest node./ index: index: test - type: test id: 1 pipeline: "my_pipeline_1" body: { @@ -92,12 +91,10 @@ body: - index: _index: test_index - _type: test_type _id: test_id - f1: v1 - index: _index: test_index - _type: test_type _id: test_id2 - f1: v2 @@ -109,12 +106,10 @@ body: - index: _index: test_index - _type: test_type _id: test_id - f1: v1 - index: _index: test_index - _type: test_type _id: test_id2 pipeline: my_pipeline_1 - f1: v2 diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/10_pipeline_with_mustache_templates.yml b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/10_pipeline_with_mustache_templates.yml index 5ffaebdcaef..0235a346ad3 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/10_pipeline_with_mustache_templates.yml +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/10_pipeline_with_mustache_templates.yml @@ -14,13 +14,13 @@ { "set" : { "field" : "index_type_id", - "value": "{{_index}}/{{_type}}/{{_id}}" + "value": "{{_index}}/{{_id}}" } }, { "append" : { "field" : "metadata", - "value": ["{{_index}}", "{{_type}}", "{{_id}}"] + "value": ["{{_index}}", "{{_id}}"] } } ] @@ -30,7 +30,6 @@ - do: index: index: test - type: test id: 1 pipeline: "my_pipeline_1" body: {} @@ -38,11 +37,10 @@ - do: get: index: test - type: test id: 1 - length: { _source: 2 } - - match: { _source.index_type_id: "test/test/1" } - - match: { _source.metadata: ["test", "test", "1"] } + - match: { _source.index_type_id: "test/1" } + - match: { _source.metadata: ["test", "1"] } --- "Test templating": @@ -110,7 +108,6 @@ - do: index: index: test - type: test id: 1 pipeline: "my_pipeline_1" body: { @@ -123,7 +120,6 @@ - do: get: index: test - type: test id: 1 - length: { _source: 5 } - match: { _source.field1: "1" } @@ -135,7 +131,6 @@ - do: index: index: test - type: test id: 1 pipeline: "my_pipeline_2" body: { @@ -145,7 +140,6 @@ - do: get: index: test - type: test id: 1 - length: { _source: 2 } - match: { _source.field1: "field2" } @@ -154,7 +148,6 @@ - do: index: index: test - type: test id: 1 pipeline: "my_pipeline_3" body: { @@ -165,7 +158,6 @@ - do: get: index: test - type: test id: 1 - length: { _source: 1 } - match: { _source.field_to_remove: "field2" } @@ -204,7 +196,6 @@ - do: index: index: test - type: test id: 1 pipeline: "my_handled_pipeline" body: { @@ -214,7 +205,6 @@ - do: get: index: test - type: test id: 1 - length: { _source: 2 } - match: { _source.do_nothing: "foo" } @@ -246,7 +236,6 @@ - do: index: index: test - type: test id: 1 pipeline: "_id" body: { @@ -268,7 +257,6 @@ - do: get: index: test - type: test id: 1 - length: { _source: 2 } - match: { _source.values_flat: ["foo_bar", "foo_baz"] } diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/20_combine_processors.yml b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/20_combine_processors.yml index c121d542c86..6d567d64532 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/20_combine_processors.yml +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/20_combine_processors.yml @@ -48,7 +48,6 @@ - do: index: index: test - type: test id: 1 pipeline: "_id" body: { @@ -58,7 +57,6 @@ - do: get: index: test - type: test id: 1 - length: { _source: 13 } - match: { _source.request: "/presentations/logstash-scale11x/images/ahhh___rage_face_by_samusmmx-d5g5zap.png" } @@ -137,7 +135,6 @@ - do: index: index: test - type: test id: 1 pipeline: "_id" body: { @@ -178,7 +175,6 @@ - do: get: index: test - type: test id: 1 - length: { _source: 11 } - is_false: _source.friends.0.id diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml index e34ca43a622..eb1c0d2eef7 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/40_reindex_with_ingest.yml @@ -18,7 +18,6 @@ - do: index: index: twitter - type: tweet id: 1 body: { "user": "foobar" } - do: diff --git a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml index cce388c2ff7..eaf6b24030a 100644 --- a/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml +++ b/qa/smoke-test-ingest-with-all-dependencies/src/test/resources/rest-api-spec/test/ingest/50_script_processor_using_painless.yml @@ -22,7 +22,6 @@ - do: index: index: test - type: test id: 1 pipeline: "my_pipeline" body: { bytes_in: 1234, bytes_out: 4321 } @@ -30,7 +29,6 @@ - do: get: index: test - type: test id: 1 - match: { _source.bytes_in: 1234 } - match: { _source.bytes_out: 4321 } @@ -72,7 +70,6 @@ - do: index: index: test - type: test id: 1 pipeline: "my_pipeline" body: { bytes_in: 1234, bytes_out: 4321 } @@ -80,7 +77,6 @@ - do: get: index: test - type: test id: 1 - match: { _source.bytes_in: 1234 } - match: { _source.bytes_out: 4321 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/41_source_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/41_source_with_types.yml deleted file mode 100644 index 3c8a86c13bd..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/41_source_with_types.yml +++ /dev/null @@ -1,76 +0,0 @@ ---- -"Source filtering": - - do: - index: - refresh: true - index: test_index - type: test_type - id: test_id_1 - body: { "foo": "bar", "bar": "foo" } - - - do: - index: - refresh: true - index: test_index - type: test_type - id: test_id_2 - body: { "foo": "qux", "bar": "pux" } - - - do: - index: - refresh: true - index: test_index - type: test_type - id: test_id_3 - body: { "foo": "corge", "bar": "forge" } - - - - do: - bulk: - refresh: true - body: | - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_source": true } } - { "doc": { "foo": "baz" } } - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2" } } - { "_source": true, "doc": { "foo": "quux" } } - - - match: { items.0.update.get._source.foo: baz } - - match: { items.1.update.get._source.foo: quux } - - - do: - bulk: - index: test_index - type: test_type - _source: true - body: | - { "update": { "_id": "test_id_3" } } - { "doc": { "foo": "garply" } } - - - match: { items.0.update.get._source.foo: garply } - - - do: - bulk: - refresh: true - body: | - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_1", "_source": {"includes": "bar"} } } - { "doc": { "foo": "baz" } } - { "update": { "_index": "test_index", "_type": "test_type", "_id": "test_id_2" } } - { "_source": {"includes": "foo"}, "doc": { "foo": "quux" } } - - - match: { items.0.update.get._source.bar: foo } - - is_false: items.0.update.get._source.foo - - match: { items.1.update.get._source.foo: quux } - - is_false: items.1.update.get._source.bar - - - do: - bulk: - index: test_index - type: test_type - _source_includes: foo - body: | - { "update": { "_id": "test_id_3" } } - { "doc": { "foo": "garply" } } - - - match: { items.0.update.get._source.foo: garply } - - is_false: items.0.update.get._source.bar - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/81_cas_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/81_cas_with_types.yml deleted file mode 100644 index 101316e7bf5..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/bulk/81_cas_with_types.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -"Compare And Swap Sequence Numbers": - - - skip: - version: " - 6.6.99" - reason: cas operations with sequence numbers was added in 6.7 - - - do: - index: - index: test_1 - type: _doc - id: 1 - body: { foo: bar } - - match: { _version: 1} - - set: { _seq_no: seqno } - - set: { _primary_term: primary_term } - - - do: - bulk: - body: - - index: - _index: test_1 - _type: _doc - _id: 1 - if_seq_no: 10000 - if_primary_term: $primary_term - - foo: bar2 - - - match: { errors: true } - - match: { items.0.index.status: 409 } - - match: { items.0.index.error.type: version_conflict_engine_exception } - - - do: - bulk: - body: - - index: - _index: test_1 - _type: _doc - _id: 1 - if_seq_no: $seqno - if_primary_term: $primary_term - - foo: bar2 - - - match: { errors: false} - - match: { items.0.index.status: 200 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/count/11_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/count/11_basic_with_types.yml index 48cfc610b43..09d96670f68 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/count/11_basic_with_types.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/count/11_basic_with_types.yml @@ -5,7 +5,6 @@ setup: - do: index: index: test - type: test id: 1 body: { foo: bar } @@ -18,7 +17,6 @@ setup: - do: count: index: test - type: test body: query: match: @@ -42,7 +40,6 @@ setup: - do: count: index: test - type: test body: { } - match: {count : 1} @@ -50,7 +47,6 @@ setup: - do: count: index: test - type: test - match: {count : 1} @@ -60,7 +56,6 @@ setup: catch: bad_request count: index: test - type: test body: match: foo: bar diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/create/11_with_id_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/create/11_with_id_with_types.yml deleted file mode 100644 index 1e58c38c7b5..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/create/11_with_id_with_types.yml +++ /dev/null @@ -1,33 +0,0 @@ ---- -"Create with ID": - - do: - create: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1"} - - match: { _version: 1} - - - do: - get: - index: test_1 - type: test - id: 1 - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1"} - - match: { _version: 1} - - match: { _source: { foo: bar }} - - - do: - catch: conflict - create: - index: test_1 - type: test - id: 1 - body: { foo: bar } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/create/15_without_id_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/create/15_without_id_with_types.yml deleted file mode 100644 index ab993281938..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/create/15_without_id_with_types.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -"Create without ID": - - do: - catch: param - create: - index: test_1 - type: test - body: { foo: bar } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/create/36_external_version_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/create/36_external_version_with_types.yml index cb8c041d710..86d0d4b59e0 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/create/36_external_version_with_types.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/create/36_external_version_with_types.yml @@ -5,7 +5,6 @@ catch: bad_request create: index: test - type: test id: 1 body: { foo: bar } version_type: external @@ -19,7 +18,6 @@ catch: bad_request create: index: test - type: test id: 2 body: { foo: bar } version_type: external diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/create/41_routing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/create/41_routing_with_types.yml deleted file mode 100644 index 752489f722c..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/create/41_routing_with_types.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - create: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get: - index: test_1 - type: test - id: 1 - routing: 5 - stored_fields: [_routing] - - - match: { _id: "1"} - - match: { _routing: "5"} - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/create/61_refresh_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/create/61_refresh_with_types.yml deleted file mode 100644 index e24bdf42603..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/create/61_refresh_with_types.yml +++ /dev/null @@ -1,82 +0,0 @@ ---- -"Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index.refresh_interval: -1 - number_of_replicas: 0 - - do: - create: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 0 } - - - do: - create: - index: test_1 - type: test - id: 2 - refresh: true - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 2 }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - do: - create: - index: test_1 - type: test - id: 1 - refresh: "" - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 1 } - ---- -"refresh=wait_for waits until changes are visible in search": - - do: - index: - index: create_60_refresh_1 - type: test - id: create_60_refresh_id1 - body: { foo: bar } - refresh: wait_for - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: create_60_refresh_1 - body: - query: { term: { _id: create_60_refresh_id1 }} - - match: { hits.total: 1 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/create/71_nested_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/create/71_nested_with_types.yml deleted file mode 100644 index 755aaca448b..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/create/71_nested_with_types.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -setup: - - do: - indices.create: - include_type_name: true - index: test_1 - body: - settings: - index.mapping.nested_objects.limit: 2 - mappings: - test_type: - properties: - nested1: - type: nested - ---- -"Indexing a doc with No. nested objects less or equal to index.mapping.nested_objects.limit should succeed": - - skip: - version: " - 6.99.99" - reason: index.mapping.nested_objects setting has been added in 7.0.0 - - do: - create: - index: test_1 - type: test_type - id: 1 - body: - "nested1" : [ { "foo": "bar" }, { "foo": "bar2" } ] - - match: { _version: 1} - ---- -"Indexing a doc with No. nested objects more than index.mapping.nested_objects.limit should fail": - - skip: - version: " - 6.99.99" - reason: index.mapping.nested_objects setting has been added in 7.0.0 - - do: - catch: /The number of nested documents has exceeded the allowed limit of \[2\]. This limit can be set by changing the \[index.mapping.nested_objects.limit\] index level setting\./ - create: - index: test_1 - type: test_type - id: 1 - body: - "nested1" : [ { "foo": "bar" }, { "foo": "bar2" }, { "foo": "bar3" } ] diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/13_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/13_basic_with_types.yml deleted file mode 100644 index a3671d5ac24..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/13_basic_with_types.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Basic": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - match: { _version: 1 } - - - do: - delete: - index: test_1 - type: test - id: 1 - - - match: { _version: 2 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml deleted file mode 100644 index d1bb4c0df34..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/14_shard_header_with_types.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -"Delete check shard header": - - - do: - indices.create: - index: foobar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: foobar - type: baz - id: 1 - body: { foo: bar } - - - do: - delete: - index: foobar - type: baz - id: 1 - - - match: { _index: foobar } - - match: { _type: baz } - - match: { _id: "1"} - - match: { _version: 2} - - match: { _shards.total: 1} - - match: { _shards.successful: 1} - - match: { _shards.failed: 0} - - is_false: _shards.pending diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/15_result_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/15_result_with_types.yml deleted file mode 100644 index d01e88be8ad..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/15_result_with_types.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -"Delete result field": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - delete: - index: test_1 - type: test - id: 1 - - - match: { result: deleted } - - - do: - catch: missing - delete: - index: test_1 - type: test - id: 1 - - - match: { result: not_found } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/21_cas_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/21_cas_with_types.yml deleted file mode 100644 index ef352a9bad6..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/21_cas_with_types.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -"Internal version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - match: { _seq_no: 0 } - - - do: - catch: conflict - delete: - index: test_1 - type: test - id: 1 - if_seq_no: 2 - if_primary_term: 1 - - - do: - delete: - index: test_1 - type: test - id: 1 - if_seq_no: 0 - if_primary_term: 1 - - - match: { _seq_no: 1 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/27_external_version_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/27_external_version_with_types.yml deleted file mode 100644 index 453d64d85bb..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/27_external_version_with_types.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -"External version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 5 - - - match: { _version: 5} - - - do: - catch: conflict - delete: - index: test_1 - type: test - id: 1 - version_type: external - version: 4 - - - do: - delete: - index: test_1 - type: test - id: 1 - version_type: external - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml deleted file mode 100644 index 70f78c17faa..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/28_external_gte_version_with_types.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -"External GTE version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 5 - - - match: { _version: 5} - - - do: - catch: conflict - delete: - index: test_1 - type: test - id: 1 - version_type: external_gte - version: 4 - - - do: - delete: - index: test_1 - type: test - id: 1 - version_type: external_gte - version: 6 - - - match: { _version: 6} - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 6 - - - match: { _version: 6} - - - do: - delete: - index: test_1 - type: test - id: 1 - version_type: external_gte - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/31_routing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/31_routing_with_types.yml deleted file mode 100644 index 6f67b3a03f4..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/31_routing_with_types.yml +++ /dev/null @@ -1,32 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - number_of_shards: 5 - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - catch: missing - delete: - index: test_1 - type: test - id: 1 - routing: 4 - - - do: - delete: - index: test_1 - type: test - id: 1 - routing: 5 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/51_refresh_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/51_refresh_with_types.yml deleted file mode 100644 index a901c1033f7..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/51_refresh_with_types.yml +++ /dev/null @@ -1,148 +0,0 @@ ---- -"Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - refresh_interval: -1 - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - refresh: true - -# If you wonder why this document get 3 as an id instead of 2, it is because the -# current routing algorithm would route 1 and 2 to the same shard while we need -# them to be different for this test to pass - - do: - index: - index: test_1 - type: test - id: 3 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { terms: { _id: [1,3] }} - - - match: { hits.total: 2 } - - - do: - delete: - index: test_1 - type: test - id: 1 - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { terms: { _id: [1,3] }} - - - match: { hits.total: 2 } - - - do: - delete: - index: test_1 - type: test - id: 3 - refresh: true - -# If a replica shard where doc 1 is located gets initialized at this point, doc 1 -# won't be found by the following search as the shard gets automatically refreshed -# right before getting started. This is why this test only works with 0 replicas. - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { terms: { _id: [1,3] }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - match: { hits.total: 1 } - - - do: - delete: - index: test_1 - type: test - id: 1 - refresh: "" - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - match: { hits.total: 0 } - ---- -"refresh=wait_for waits until changes are visible in search": - - do: - index: - index: delete_50_refresh_1 - type: test - id: delete_50_refresh_id1 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: delete_50_refresh_1 - body: - query: { term: { _id: delete_50_refresh_id1 }} - - match: { hits.total: 1 } - - - do: - delete: - index: delete_50_refresh_1 - type: test - id: delete_50_refresh_id1 - refresh: wait_for - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: delete_50_refresh_1 - body: - query: { term: { _id: delete_50_refresh_id1 }} - - match: { hits.total: 0 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/61_missing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/61_missing_with_types.yml deleted file mode 100644 index 9cfdb48ae20..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/61_missing_with_types.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Missing document with catch": - - - do: - catch: missing - delete: - index: test_1 - type: test - id: 1 - ---- -"Missing document with ignore": - - - do: - delete: - index: test_1 - type: test - id: 1 - ignore: 404 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml deleted file mode 100644 index e0f20795e41..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/delete/70_mix_typeless_typeful.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"DELETE with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - catch: bad_request - delete: - index: index - type: some_random_type - id: 1 - - - match: { error.root_cause.0.reason: "/Rejecting.mapping.update.to.\\[index\\].as.the.final.mapping.would.have.more.than.1.type.*/" } - - - do: - delete: - index: index - id: 1 - - - match: { _index: "index" } - - match: { _type: "_doc" } - - match: { _id: "1"} - - match: { _version: 2} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/exists/11_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/exists/11_basic_with_types.yml deleted file mode 100644 index 7e4e26b6b1c..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/exists/11_basic_with_types.yml +++ /dev/null @@ -1,36 +0,0 @@ ---- -"Basic": - - - do: - exists: - index: test_1 - type: test - id: 1 - - - is_false: '' - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - is_true: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - - - is_true: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - version: 1 - - - is_true: '' diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/exists/41_routing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/exists/41_routing_with_types.yml deleted file mode 100644 index 25315628d7e..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/exists/41_routing_with_types.yml +++ /dev/null @@ -1,41 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - exists: - index: test_1 - type: test - id: 1 - routing: 5 - - - is_true: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - - - is_false: '' diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml deleted file mode 100644 index df8c697e4a1..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/exists/61_realtime_refresh_with_types.yml +++ /dev/null @@ -1,50 +0,0 @@ ---- -"Realtime Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - exists: - index: test_1 - type: test - id: 1 - realtime: false - - - is_false: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - realtime: true - - - is_true: '' - - - do: - exists: - index: test_1 - type: test - id: 1 - realtime: false - refresh: true - - - is_true: '' diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/exists/71_defaults_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/exists/71_defaults_with_types.yml deleted file mode 100644 index 2db28f6634b..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/exists/71_defaults_with_types.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -"Client-side default type": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - do: - exists: - index: test_1 - type: _all - id: 1 - - - is_true: '' diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/11_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/explain/11_basic_with_types.yml deleted file mode 100644 index 5f211435ae9..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/11_basic_with_types.yml +++ /dev/null @@ -1,66 +0,0 @@ -setup: - - do: - indices.create: - index: test_1 - body: - aliases: - alias_1: - "filter" : { "term" : { "foo" : "bar"} } - - - do: - index: - index: test_1 - type: test - id: id_1 - body: { foo: bar, title: howdy } - - - do: - indices.refresh: {} - ---- -"Basic explain": - - - do: - explain: - index: test_1 - type: test - id: id_1 - body: - query: - match_all: {} - - - is_true: matched - - match: { explanation.value: 1 } - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: id_1 } - ---- -"Basic explain with alias": - - - do: - explain: - index: alias_1 - type: test - id: id_1 - body: - query: - match_all: {} - - - is_true: matched - - match: { explanation.value: 1 } - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: id_1 } - ---- -"Explain body without query element": - - do: - catch: bad_request - explain: - index: test_1 - type: test - id: id_1 - body: - match_all: {} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml deleted file mode 100644 index e13edf7be50..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/21_source_filtering_with_types.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -"Source filtering": - - do: - index: - index: test_1 - type: test - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - indices.refresh: - index: test_1 - - - do: - explain: { index: test_1, type: test, id: 1, _source: false, body: { query: { match_all: {}} } } - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1" } - - is_false: get._source - - - do: - explain: { index: test_1, type: test, id: 1, _source: true, body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - - do: - explain: { index: test_1, type: test, id: 1, _source: include.field1, body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - is_false: get._source.include.field2 - - - do: - explain: { index: test_1, type: test, id: 1, _source_includes: include.field1, body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - is_false: get._source.include.field2 - - - do: - explain: { index: test_1, type: test, id: 1, _source_includes: "include.field1,include.field2", body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - match: { get._source.include.field2: v2 } - - is_false: get._source.count - - - do: - explain: { index: test_1, type: test, id: 1, _source_includes: include, _source_excludes: "*.field2", body: { query: { match_all: {}} } } - - match: { get._source.include.field1: v1 } - - is_false: get._source.include.field2 - - is_false: get._source.count diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/31_query_string_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/explain/31_query_string_with_types.yml deleted file mode 100644 index b6930688acf..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/31_query_string_with_types.yml +++ /dev/null @@ -1,71 +0,0 @@ ---- -"explain with query_string parameters": - - do: - indices.create: - include_type_name: true - index: test - body: - mappings: - test: - properties: - number: - type: integer - - - do: - index: - index: test - type: test - id: 1 - body: { field: foo bar} - - - do: - indices.refresh: - index: [test] - - - do: - explain: - index: test - type: test - id: 1 - q: bar - df: field - - - is_true: matched - - - do: - explain: - index: test - type: test - id: 1 - q: field:foo field:xyz - - - is_true: matched - - - do: - explain: - index: test - type: test - id: 1 - q: field:foo field:xyz - default_operator: AND - - - is_false: matched - - - do: - explain: - index: test - type: test - id: 1 - q: field:BA* - - - is_true: matched - - - do: - explain: - index: test - type: test - id: 1 - q: number:foo - lenient: true - - - is_false: matched diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml deleted file mode 100644 index 36fdbaa6b6f..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/explain/40_mix_typeless_typeful.yml +++ /dev/null @@ -1,57 +0,0 @@ ---- -"Explain with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - catch: missing - explain: - index: index - type: some_random_type - id: 1 - body: - query: - match_all: {} - - - match: { _index: "index" } - - match: { _type: "some_random_type" } - - match: { _id: "1"} - - match: { matched: false} - - - do: - explain: - index: index - type: _doc #todo: make _explain typeless and remove this - id: 1 - body: - query: - match_all: {} - - - match: { _index: "index" } - - match: { _type: "_doc" } - - match: { _id: "1"} - - is_true: matched - - match: { explanation.value: 1 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml deleted file mode 100644 index d13229dbffb..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/100_mix_typeless_typeful.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -"GET with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - catch: missing - get: - index: index - type: some_random_type - id: 1 - - - match: { _index: "index" } - - match: { _type: "some_random_type" } - - match: { _id: "1"} - - match: { found: false} - - - do: - get: - index: index - id: 1 - - - match: { _index: "index" } - - match: { _type: "_doc" } - - match: { _id: "1"} - - match: { _version: 1} - - match: { _source: { foo: bar }} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/11_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/11_basic_with_types.yml deleted file mode 100644 index 0689f714d64..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/11_basic_with_types.yml +++ /dev/null @@ -1,31 +0,0 @@ ---- -"Basic": - - - do: - index: - index: test_1 - type: test - id: 中文 - body: { "foo": "Hello: 中文" } - - - do: - get: - index: test_1 - type: test - id: 中文 - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: 中文 } - - match: { _source: { foo: "Hello: 中文" } } - - - do: - get: - index: test_1 - type: _all - id: 中文 - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: 中文 } - - match: { _source: { foo: "Hello: 中文" } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/16_default_values_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/16_default_values_with_types.yml deleted file mode 100644 index 5e08112253e..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/16_default_values_with_types.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"Default values": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - do: - get: - index: test_1 - type: _all - id: 1 - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: '1' } - - match: { _source: { foo: "bar" } } - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml deleted file mode 100644 index d1862fc0340..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/21_stored_fields_with_types.yml +++ /dev/null @@ -1,60 +0,0 @@ ---- -"Stored fields": - - - do: - indices.create: - include_type_name: true - index: test_1 - body: - mappings: - test: - properties: - foo: - type: keyword - store: true - count: - type: integer - store: true - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar", "count": 1 } - - do: - get: - index: test_1 - type: test - id: 1 - stored_fields: foo - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: '1' } - - match: { fields.foo: [bar] } - - is_false: _source - - - do: - get: - index: test_1 - type: test - id: 1 - stored_fields: [foo, count] - - - match: { fields.foo: [bar] } - - match: { fields.count: [1] } - - is_false: _source - - - do: - get: - index: test_1 - type: test - id: 1 - stored_fields: [foo, count, _source] - - - match: { fields.foo: [bar] } - - match: { fields.count: [1] } - - match: { _source.foo: bar } - - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/41_routing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/41_routing_with_types.yml deleted file mode 100644 index 276346cda4f..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/41_routing_with_types.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get: - index: test_1 - type: test - id: 1 - routing: 5 - stored_fields: [_routing] - - - match: { _id: "1"} - - match: { _routing: "5"} - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/51_with_headers_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/51_with_headers_with_types.yml deleted file mode 100644 index b88dbaafc4f..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/51_with_headers_with_types.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -"REST test with headers": - - skip: - features: ["headers", "yaml"] - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "body": "foo" } - - - do: - headers: - Accept: application/yaml - get: - index: test_1 - type: _all - id: 1 - - - match: {_index: "test_1"} - - match: {_type: "test"} - - match: {_id: "1"} - - match: {_version: 1} - - match: {found: true} - - match: { _source: { body: foo }} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml deleted file mode 100644 index 7d02b4667ef..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/61_realtime_refresh_with_types.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -"Realtime Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - realtime: false - - - do: - get: - index: test_1 - type: test - id: 1 - realtime: true - - - is_true: found - - - do: - get: - index: test_1 - type: test - id: 1 - realtime: false - refresh: true - - - is_true: found diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml deleted file mode 100644 index 3ac493c629f..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/71_source_filtering_with_types.yml +++ /dev/null @@ -1,69 +0,0 @@ ---- -"Source filtering": - - - do: - indices.create: - include_type_name: true - index: test_1 - body: - mappings: - test: - properties: - count: - type: integer - store: true - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - get: { index: test_1, type: test, id: 1, _source: false } - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1" } - - is_false: _source - - - do: - get: { index: test_1, type: test, id: 1, _source: true } - - match: { _source.include.field1: v1 } - - - do: - get: { index: test_1, type: test, id: 1, _source: include.field1 } - - match: { _source.include.field1: v1 } - - is_false: _source.include.field2 - - - do: - get: { index: test_1, type: test, id: 1, _source_includes: include.field1 } - - match: { _source.include.field1: v1 } - - is_false: _source.include.field2 - - - do: - get: { index: test_1, type: test, id: 1, _source_includes: "include.field1,include.field2" } - - match: { _source.include.field1: v1 } - - match: { _source.include.field2: v2 } - - is_false: _source.count - - - do: - get: { index: test_1, type: test, id: 1, _source_includes: include, _source_excludes: "*.field2" } - - match: { _source.include.field1: v1 } - - is_false: _source.include.field2 - - is_false: _source.count - - - - do: - get: - index: test_1 - type: test - id: 1 - stored_fields: count - _source: true - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: "1" } - - match: { fields.count: [1] } - - match: { _source.include.field1: v1 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/81_missing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/81_missing_with_types.yml deleted file mode 100644 index a60d1138856..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/81_missing_with_types.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Missing document with catch": - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - ---- -"Missing document with ignore": - - - do: - get: - index: test_1 - type: test - id: 1 - ignore: 404 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get/91_versions_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get/91_versions_with_types.yml deleted file mode 100644 index c6631b83b18..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get/91_versions_with_types.yml +++ /dev/null @@ -1,89 +0,0 @@ ---- -"Versions": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - match: { _version: 1} - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - match: { _version: 2} - - - do: - get: - index: test_1 - type: test - id: 1 - version: 2 - - match: { _id: "1" } - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 1 - - - do: - get: - index: test_1 - type: test - id: 1 - version: 2 - version_type: external - - match: { _id: "1" } - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 10 - version_type: external - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 1 - version_type: external - - - do: - get: - index: test_1 - type: test - id: 1 - version: 2 - version_type: external_gte - - match: { _id: "1" } - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 10 - version_type: external_gte - - - do: - catch: conflict - get: - index: test_1 - type: test - id: 1 - version: 1 - version_type: external_gte - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/11_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/11_basic_with_types.yml deleted file mode 100644 index 1446f569e86..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/11_basic_with_types.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -"Basic with types": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - do: - get_source: - index: test_1 - type: test - id: 1 - - - match: { '': { foo: bar } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml deleted file mode 100644 index e2de7a9f000..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/16_default_values_with_types.yml +++ /dev/null @@ -1,16 +0,0 @@ ---- -"Default values": - - do: - index: - index: test_1 - type: test - id: 1 - body: { "foo": "bar" } - - - do: - get_source: - index: test_1 - type: test - id: 1 - - - match: { '': { foo: bar } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/41_routing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/41_routing_with_types.yml deleted file mode 100644 index db53a33ba59..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/41_routing_with_types.yml +++ /dev/null @@ -1,42 +0,0 @@ ---- -"Routing": - - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get_source: - index: test_1 - type: test - id: 1 - routing: 5 - - - match: { '': {foo: bar}} - - - do: - catch: missing - get_source: - index: test_1 - type: test - id: 1 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml deleted file mode 100644 index f5b406de28b..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/61_realtime_refresh_with_types.yml +++ /dev/null @@ -1,49 +0,0 @@ ---- -"Realtime": - - - do: - indices.create: - index: test_1 - body: - settings: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - catch: missing - get_source: - index: test_1 - type: test - id: 1 - realtime: false - - - do: - get_source: - index: test_1 - type: test - id: 1 - realtime: true - - - match: { '': {foo: bar}} - - - do: - get_source: - index: test_1 - type: test - id: 1 - realtime: false - refresh: true - - - match: { '': {foo: bar}} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml deleted file mode 100644 index b4f20fee53b..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/71_source_filtering_with_types.yml +++ /dev/null @@ -1,27 +0,0 @@ ---- -"Source filtering": - - - - do: - index: - index: test_1 - type: test - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - - do: - get_source: { index: test_1, type: test, id: 1, _source_includes: include.field1 } - - match: { include.field1: v1 } - - is_false: include.field2 - - - do: - get_source: { index: test_1, type: test, id: 1, _source_includes: "include.field1,include.field2" } - - match: { include.field1: v1 } - - match: { include.field2: v2 } - - is_false: count - - - do: - get_source: { index: test_1, type: test, id: 1, _source_includes: include, _source_excludes: "*.field2" } - - match: { include.field1: v1 } - - is_false: include.field2 - - is_false: count diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/81_missing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/81_missing_with_types.yml deleted file mode 100644 index 16eb5ea51e8..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/81_missing_with_types.yml +++ /dev/null @@ -1,19 +0,0 @@ ---- -"Missing document with catch": - - - do: - catch: missing - get_source: - index: test_1 - type: test - id: 1 - ---- -"Missing document with ignore": - - - do: - get_source: - index: test_1 - type: test - id: 1 - ignore: 404 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml deleted file mode 100644 index d7cfced5164..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/get_source/86_source_missing_with_types.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -setup: - - - do: - indices.create: - include_type_name: true - index: test_1 - body: - mappings: - test: - _source: { enabled: false } - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - ---- -"Missing document source with catch": - - - do: - catch: missing - get_source: - index: test_1 - type: test - id: 1 - ---- -"Missing document source with ignore": - - - do: - get_source: - index: test_1 - type: test - id: 1 - ignore: 404 diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/11_with_id_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/11_with_id_with_types.yml deleted file mode 100644 index daac81849fb..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/11_with_id_with_types.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -"Index with ID": - - - do: - index: - index: test-weird-index-中文 - type: weird.type - id: 1 - body: { foo: bar } - - - match: { _index: test-weird-index-中文 } - - match: { _type: weird.type } - - match: { _id: "1"} - - match: { _version: 1} - - - do: - get: - index: test-weird-index-中文 - type: weird.type - id: 1 - - - match: { _index: test-weird-index-中文 } - - match: { _type: weird.type } - - match: { _id: "1"} - - match: { _version: 1} - - match: { _source: { foo: bar }} - - - do: - catch: bad_request - index: - index: idx - type: type - id: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa - body: { foo: bar } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/13_result_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/13_result_with_types.yml deleted file mode 100644 index 45ebe0bbd3d..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/13_result_with_types.yml +++ /dev/null @@ -1,21 +0,0 @@ ---- -"Index result field": - - - do: - index: - index: test_index - type: test - id: 1 - body: { foo: bar } - - - match: { result: created } - - - do: - index: - index: test_index - type: test - id: 1 - body: { foo: bar } - op_type: index - - - match: { result: updated } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/16_without_id_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/16_without_id_with_types.yml deleted file mode 100644 index 3fff0512b96..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/16_without_id_with_types.yml +++ /dev/null @@ -1,26 +0,0 @@ ---- -"Index without ID": - - - do: - index: - index: test_1 - type: test - body: { foo: bar } - - - is_true: _id - - match: { _index: test_1 } - - match: { _type: test } - - match: { _version: 1 } - - set: { _id: id } - - - do: - get: - index: test_1 - type: test - id: '$id' - - - match: { _index: test_1 } - - match: { _type: test } - - match: { _id: $id } - - match: { _version: 1 } - - match: { _source: { foo: bar }} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/21_optype_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/21_optype_with_types.yml deleted file mode 100644 index 60ae26d46d0..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/21_optype_with_types.yml +++ /dev/null @@ -1,29 +0,0 @@ ---- -"Optype": - - - do: - index: - index: test_1 - type: test - id: 1 - op_type: create - body: { foo: bar } - - - do: - catch: conflict - index: - index: test_1 - type: test - id: 1 - op_type: create - body: { foo: bar } - - - do: - index: - index: test_1 - type: test - id: 1 - op_type: index - body: { foo: bar } - - - match: { _version: 2 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/37_external_version_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/37_external_version_with_types.yml deleted file mode 100644 index f17e6b74931..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/37_external_version_with_types.yml +++ /dev/null @@ -1,55 +0,0 @@ ---- -"External version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 0 - - - match: { _version: 0 } - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 5 - - - match: { _version: 5 } - - - do: - catch: conflict - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 5 - - - do: - catch: conflict - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 0 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml deleted file mode 100644 index dccbe02ea14..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/38_external_gte_version_with_types.yml +++ /dev/null @@ -1,56 +0,0 @@ ---- -"External GTE version": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 0 - - - match: { _version: 0} - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 5 - - - match: { _version: 5} - - - do: - catch: conflict - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - version_type: external_gte - version: 0 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar2 } - version_type: external_gte - version: 5 - - - match: { _version: 5} - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar2 } - version_type: external_gte - version: 6 - - - match: { _version: 6} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/41_routing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/41_routing_with_types.yml deleted file mode 100644 index 5b0cf94f423..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/41_routing_with_types.yml +++ /dev/null @@ -1,43 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - get: - index: test_1 - type: test - id: 1 - routing: 5 - stored_fields: [_routing] - - - match: { _id: "1"} - - match: { _routing: "5"} - - - do: - catch: missing - get: - index: test_1 - type: test - id: 1 - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/index/61_refresh_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/index/61_refresh_with_types.yml deleted file mode 100644 index be44cafd430..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/index/61_refresh_with_types.yml +++ /dev/null @@ -1,83 +0,0 @@ ---- -"Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index.refresh_interval: -1 - number_of_replicas: 0 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 0 } - - - do: - index: - index: test_1 - type: test - id: 2 - refresh: true - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 2 }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - do: - index: - index: test_1 - type: test - id: 1 - refresh: "" - body: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 1 } - ---- -"refresh=wait_for waits until changes are visible in search": - - do: - index: - index: index_60_refresh_1 - type: test - id: index_60_refresh_id1 - body: { foo: bar } - refresh: wait_for - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: index_60_refresh_1 - body: - query: { term: { _id: index_60_refresh_id1 }} - - match: { hits.total: 1 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml deleted file mode 100644 index f5aeb537511..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/11_basic_with_types.yml +++ /dev/null @@ -1,143 +0,0 @@ ---- -"Create index with mappings": - - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - type_1: {} - - - do: - indices.get_mapping: - include_type_name: true - index: test_index - - - is_true: test_index.mappings.type_1 - ---- -"Create index with settings": - - - do: - indices.create: - include_type_name: true - index: test_index - body: - settings: - number_of_replicas: "0" - - - do: - indices.get_settings: - index: test_index - - - match: { test_index.settings.index.number_of_replicas: "0"} - ---- -"Create index": - - - do: - indices.create: - include_type_name: true - index: test_index - - - match: { acknowledged: true } - - match: { index: "test_index"} - ---- -"Create index with wait_for_active_shards set to all": - - - do: - indices.create: - include_type_name: true - index: test_index - wait_for_active_shards: all - body: - settings: - number_of_replicas: "0" - - - match: { acknowledged: true } - - match: { shards_acknowledged: true } - ---- -"Create index with aliases": - - - do: - indices.create: - include_type_name: true - index: test_index - body: - mappings: - type_1: - properties: - field: - type: text - aliases: - test_alias: {} - test_blias: - routing: b - test_clias: - filter: - term: - field : value - - - do: - indices.get_alias: - index: test_index - - - match: {test_index.aliases.test_blias.search_routing: b} - - match: {test_index.aliases.test_blias.index_routing: b} - - is_false: test_index.aliases.test_blias.filter - - match: {test_index.aliases.test_clias.filter.term.field: value} - - is_false: test_index.aliases.test_clias.index_routing - - is_false: test_index.aliases.test_clias.search_routing - ---- -"Create index with write aliases": - - skip: - version: " - 6.99.99" - reason: is_write_index is not implemented in ES <= 6.x - - do: - indices.create: - include_type_name: true - index: test_index - body: - aliases: - test_alias: {} - test_blias: - is_write_index: false - test_clias: - is_write_index: true - - - do: - indices.get_alias: - index: test_index - - - is_false: test_index.aliases.test_alias.is_write_index - - is_false: test_index.aliases.test_blias.is_write_index - - is_true: test_index.aliases.test_clias.is_write_index - ---- -"Create index with no type mappings": - - do: - catch: /illegal_argument_exception/ - indices.create: - include_type_name: true - index: test_index - body: - mappings: - "" : {} - ---- -"Create index with invalid mappings": - - do: - catch: /illegal_argument_exception/ - indices.create: - include_type_name: true - index: test_index - body: - mappings: - test_type: - properties: - "": - type: keyword diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml deleted file mode 100644 index 9167574ea9a..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.create/20_mix_typeless_typeful.yml +++ /dev/null @@ -1,149 +0,0 @@ ---- -"Create a typeless index while there is a typed template": - - - skip: - version: " - 6.6.99" - reason: Merging typeless/typed mappings/templates was added in 6.7 - features: allowed_warnings - - - do: - indices.put_template: - include_type_name: true - name: test_template - body: - index_patterns: test-* - mappings: - my_type: - properties: - foo: - type: keyword - - - do: - allowed_warnings: - - "index [test-1] matches multiple legacy templates [global, test_template], composable templates will only match a single template" - indices.create: - index: test-1 - body: - mappings: - properties: - bar: - type: "long" - - - do: - indices.get_mapping: - include_type_name: true - index: test-1 - - - is_true: test-1.mappings._doc # the index creation call won - - is_false: test-1.mappings.my_type - - is_true: test-1.mappings._doc.properties.foo - - is_true: test-1.mappings._doc.properties.bar - ---- -"Create a typed index while there is a typeless template": - - - skip: - version: " - 6.6.99" - reason: Merging typeless/typed mappings/templates was added in 6.7 - features: allowed_warnings - - - do: - indices.put_template: - include_type_name: false - name: test_template - body: - index_patterns: test-* - mappings: - properties: - foo: - type: keyword - - - do: - allowed_warnings: - - "index [test-1] matches multiple legacy templates [global, test_template], composable templates will only match a single template" - indices.create: - include_type_name: true - index: test-1 - body: - mappings: - my_type: - properties: - bar: - type: "long" - - - do: - indices.get_mapping: - include_type_name: true - index: test-1 - - - is_true: test-1.mappings.my_type # the index creation call won - - is_false: test-1.mappings._doc - - is_true: test-1.mappings.my_type.properties.foo - - is_true: test-1.mappings.my_type.properties.bar - ---- -"Implicitly create a typed index while there is a typeless template": - - - skip: - version: " - 6.99.99" - reason: include_type_name only supported as of 6.7 - - - do: - indices.put_template: - include_type_name: false - name: test_template - body: - index_patterns: test-* - mappings: - properties: - foo: - type: keyword - - - do: - catch: /the final mapping would have more than 1 type/ - index: - index: test-1 - type: my_type - body: { bar: 42 } - ---- -"Implicitly create a typeless index while there is a typed template": - - - skip: - version: " - 6.99.99" - reason: needs typeless index operations to work on typed indices - features: allowed_warnings - - - do: - indices.put_template: - include_type_name: true - name: test_template - body: - index_patterns: test-* - mappings: - my_type: - properties: - foo: - type: keyword - - - do: - allowed_warnings: - - "index [test-1] matches multiple legacy templates [global, test_template], composable templates will only match a single template" - index: - index: test-1 - body: { bar: 42 } - -# ensures dynamic mapping update is visible to get_mapping - - do: - cluster.health: - wait_for_events: normal - - - do: - indices.get_mapping: - include_type_name: true - index: test-1 - - - is_true: test-1.mappings.my_type # the template is honored - - is_false: test-1.mappings._doc - - is_true: test-1.mappings.my_type.properties.foo - - is_true: test-1.mappings.my_type.properties.bar diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.flush/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.flush/10_basic.yml index 4ac82ec60e7..0fdb4d08543 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.flush/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.flush/10_basic.yml @@ -20,7 +20,6 @@ - do: index: index: test - type: doc id: 1 body: { "message": "a long message to make a periodic flush happen after this index operation" } - do: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml index 342adced064..dc68ffc9a3b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/10_basic.yml @@ -16,20 +16,17 @@ - do: index: index: logs-1 - type: test id: "1" body: { "foo": "hello world" } # make this doc visible in index stats refresh: true - + - do: get: index: logs_search - type: test id: "1" - match: { _index: logs-1 } - - match: { _type: test } - match: { _id: "1" } - match: { _source: { foo: "hello world" } } @@ -59,7 +56,6 @@ - do: index: index: logs-000002 - type: test id: "2" body: { "foo": "hello world" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml index ec9fabe0259..f5d223259dc 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/20_max_doc_condition.yml @@ -17,7 +17,6 @@ - do: index: index: logs-1 - type: test id: "1" body: { "foo": "hello world" } refresh: true @@ -38,7 +37,6 @@ - do: index: index: logs-1 - type: test id: "2" body: { "foo": "hello world" } refresh: true diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml index 6e4df0f2929..c99f736a249 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/30_max_size_condition.yml @@ -18,7 +18,6 @@ - do: index: index: logs-1 - type: doc id: "1" body: { "foo": "hello world" } refresh: true diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml deleted file mode 100644 index 36389f3ce8b..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.rollover/41_mapping_with_types.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -"Typeless mapping": - - skip: - version: " - 6.99.99" - reason: include_type_name defaults to true before 7.0.0 - - - do: - indices.create: - index: logs-1 - body: - aliases: - logs_search: {} - - # index first document and wait for refresh - - do: - index: - index: logs-1 - type: test - id: "1" - body: { "foo": "hello world" } - refresh: true - - # index second document and wait for refresh - - do: - index: - index: logs-1 - type: test - id: "2" - body: { "foo": "hello world" } - refresh: true - - # perform alias rollover with new typeless mapping - - do: - indices.rollover: - include_type_name: true - alias: "logs_search" - body: - conditions: - max_docs: 2 - mappings: - _doc: - properties: - foo2: - type: keyword - - - match: { conditions: { "[max_docs: 2]": true } } - - match: { rolled_over: true } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.segments/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.segments/10_basic.yml index 37602774474..bda7788354b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.segments/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.segments/10_basic.yml @@ -25,7 +25,6 @@ - do: index: index: index1 - type: type body: { foo: bar } refresh: true @@ -53,7 +52,6 @@ - do: index: index: index1 - type: type body: { foo: bar } refresh: true diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml index b6f1c7e5527..1f621c2e50b 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.shard_stores/10_basic.yml @@ -24,7 +24,6 @@ - do: index: index: index1 - type: type body: { foo: bar } refresh: true @@ -59,13 +58,11 @@ - do: index: index: index1 - type: type body: { foo: bar } refresh: true - do: index: index: index2 - type: type body: { foo: bar } refresh: true - do: diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.stats/15_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/indices.stats/15_types.yml deleted file mode 100644 index e2f31c34057..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/indices.stats/15_types.yml +++ /dev/null @@ -1,81 +0,0 @@ ---- -setup: - - - do: - index: - index: test1 - type: bar - id: 1 - body: { "bar": "bar", "baz": "baz" } - - - do: - index: - index: test2 - type: baz - id: 1 - body: { "bar": "bar", "baz": "baz" } - - ---- -"Types - blank": - - do: - indices.stats: {} - - - match: { _all.primaries.indexing.index_total: 2 } - - is_false: _all.primaries.indexing.types - ---- -"Types - one": - - do: - indices.stats: { types: bar } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz - ---- -"Types - multi": - - do: - indices.stats: { types: "bar,baz" } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - match: { _all.primaries.indexing.types.baz.index_total: 1 } - ---- -"Types - star": - - do: - indices.stats: { types: "*" } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - match: { _all.primaries.indexing.types.baz.index_total: 1 } - ---- -"Types - pattern": - - do: - indices.stats: { types: "*r" } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz - ---- -"Types - _all metric": - - do: - indices.stats: { types: bar, metric: _all } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz - ---- -"Types - indexing metric": - - do: - indices.stats: { types: bar, metric: indexing } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz - ---- -"Types - multi metric": - - do: - indices.stats: { types: bar, metric: [ indexing, search ] } - - - match: { _all.primaries.indexing.types.bar.index_total: 1 } - - is_false: _all.primaries.indexing.types.baz diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/11_default_index_type.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/11_default_index_type.yml deleted file mode 100644 index 773b7e3bcfe..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/11_default_index_type.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -"Default index/type": - - do: - indices.create: - index: test_2 - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - mget: - index: test_1 - type: test - body: - docs: - - { _index: test_2, _id: 1} - - { _type: none, _id: 1} - - { _id: 2} - - { _id: 1} - - - is_false: docs.0.found - - match: { docs.0._index: test_2 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - - is_false: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: none } - - match: { docs.1._id: "1" } - - - is_false: docs.2.found - - match: { docs.2._index: test_1 } - - match: { docs.2._type: test } - - match: { docs.2._id: "2" } - - - is_true: docs.3.found - - match: { docs.3._index: test_1 } - - match: { docs.3._type: test } - - match: { docs.3._id: "1" } - - match: { docs.3._version: 1 } - - match: { docs.3._source: { foo: bar }} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/16_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/16_basic_with_types.yml deleted file mode 100644 index 0850772ad42..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/16_basic_with_types.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -"Basic multi-get": - - do: - indices.create: - index: test_2 - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - mget: - body: - docs: - - { _index: test_2, _type: test, _id: 1} - - { _index: test_1, _type: none, _id: 1} - - { _index: test_1, _type: test, _id: 2} - - { _index: test_1, _type: test, _id: 1} - - - is_false: docs.0.found - - match: { docs.0._index: test_2 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - - is_false: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: none } - - match: { docs.1._id: "1" } - - - is_false: docs.2.found - - match: { docs.2._index: test_1 } - - match: { docs.2._type: test } - - match: { docs.2._id: "2" } - - - is_true: docs.3.found - - match: { docs.3._index: test_1 } - - match: { docs.3._type: test } - - match: { docs.3._id: "1" } - - match: { docs.3._version: 1 } - - match: { docs.3._source: { foo: bar }} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml deleted file mode 100644 index 06234642250..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/18_non_existent_index_with_types.yml +++ /dev/null @@ -1,30 +0,0 @@ ---- -"Non-existent index": - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - mget: - body: - docs: - - { _index: test_2, _type: test, _id: 1} - - - is_false: docs.0.found - - match: { docs.0._index: test_2 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - - do: - mget: - body: - docs: - - { _index: test_1, _type: test, _id: 1} - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml deleted file mode 100644 index d7af1797f7a..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/19_missing_metadata_with_types.yml +++ /dev/null @@ -1,47 +0,0 @@ ---- -"Missing metadata": - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - catch: /action_request_validation_exception.+ id is missing/ - mget: - body: - docs: - - { _index: test_1, _type: test} - - - do: - catch: /action_request_validation_exception.+ index is missing/ - mget: - body: - docs: - - { _type: test, _id: 1} - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - body: - docs: [] - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - body: {} - - - do: - mget: - body: - docs: - - { _index: test_1, _id: 1} - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - match: { docs.0._version: 1 } - - match: { docs.0._source: { foo: bar }} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml deleted file mode 100644 index 8b8ff6cbdb7..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/21_alias_to_multiple_indices_with_types.yml +++ /dev/null @@ -1,45 +0,0 @@ ---- -"Multi Get with alias that resolves to multiple indices": - - skip: - version: " - 7.8.99" - reason: "message was changed to fix grammar in 7.9" - - - do: - bulk: - refresh: true - body: | - {"index": {"_index": "test_1", "_type": "test", "_id": 1}} - { "foo": "bar" } - {"index": {"_index": "test_2", "_type": "test", "_id": 2}} - { "foo": "bar" } - {"index": {"_index": "test_3", "_type": "test", "_id": 3}} - { "foo": "bar" } - - - do: - indices.put_alias: - index: test_2 - name: test_two_and_three - - - do: - indices.put_alias: - index: test_3 - name: test_two_and_three - - - do: - mget: - body: - docs: - - { _index: test_1, _type: test, _id: 1} - - { _index: test_two_and_three, _type: test, _id: 2} - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - - is_false: docs.1.found - - match: { docs.1._index: test_two_and_three } - - match: { docs.1._type: test } - - match: { docs.1._id: "2" } - - match: { docs.1.error.root_cause.0.type: "illegal_argument_exception" } - - match: { docs.1.error.root_cause.0.reason: "/[aA]lias.\\[test_two_and_three\\].has.more.than.one.index.associated.with.it.\\[test_[23]{1},.test_[23]{1}\\],.can't.execute.a.single.index.op/" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/22_ids_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/22_ids_with_types.yml deleted file mode 100644 index 6c233e4d92a..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/22_ids_with_types.yml +++ /dev/null @@ -1,72 +0,0 @@ ---- -"IDs": - - do: - indices.create: - index: test_1 - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - index: - index: test_1 - type: test - id: 2 - body: { foo: baz } - - - do: - mget: - index: test_1 - type: test - body: - ids: [1, 3] - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - match: { docs.0._version: 1 } - - match: { docs.0._source: { foo: bar }} - - - is_false: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: test } - - match: { docs.1._id: "3" } - - - do: - mget: - index: test_1 - body: - ids: [1, 2] - - - is_true: docs.0.found - - match: { docs.0._index: test_1 } - - match: { docs.0._type: test } - - match: { docs.0._id: "1" } - - match: { docs.0._version: 1 } - - match: { docs.0._source: { foo: bar }} - - - is_true: docs.1.found - - match: { docs.1._index: test_1 } - - match: { docs.1._type: test } - - match: { docs.1._id: "2" } - - match: { docs.1._version: 1 } - - match: { docs.1._source: { foo: baz }} - - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - index: test_1 - body: - ids: [] - - - do: - catch: /action_request_validation_exception.+ no documents to get/ - mget: - index: test_1 - body: {} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml deleted file mode 100644 index 05b9738d461..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/23_stored_fields_with_types.yml +++ /dev/null @@ -1,120 +0,0 @@ ---- -"Stored fields": - - - do: - indices.create: - include_type_name: true - index: test_1 - body: - mappings: - test: - properties: - foo: - type: keyword - store: true - count: - type: integer - store: true - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - mget: - index: test_1 - type: test - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - is_false: docs.0.fields - - match: { docs.0._source: { foo: bar }} - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - - - do: - mget: - index: test_1 - type: test - stored_fields: foo - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - match: { docs.0.fields.foo: [bar] } - - is_false: docs.0._source - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - - - do: - mget: - index: test_1 - type: test - stored_fields: [foo] - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - match: { docs.0.fields.foo: [bar] } - - is_false: docs.0._source - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - - - do: - mget: - index: test_1 - type: test - stored_fields: [foo, _source] - body: - docs: - - { _id: 1 } - - { _id: 1, stored_fields: foo } - - { _id: 1, stored_fields: [foo] } - - { _id: 1, stored_fields: [foo, _source] } - - - match: { docs.0.fields.foo: [bar] } - - match: { docs.0._source: { foo: bar }} - - - match: { docs.1.fields.foo: [bar] } - - is_false: docs.1._source - - - match: { docs.2.fields.foo: [bar] } - - is_false: docs.2._source - - - match: { docs.3.fields.foo: [bar] } - - match: { docs.3._source: { foo: bar }} - diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/41_routing_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/41_routing_with_types.yml deleted file mode 100644 index d550dd26657..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/41_routing_with_types.yml +++ /dev/null @@ -1,44 +0,0 @@ ---- -"Routing": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - number_of_shards: 5 - number_of_routing_shards: 5 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - routing: 5 - body: { foo: bar } - - - do: - mget: - index: test_1 - type: test - stored_fields: [_routing] - body: - docs: - - { _id: 1 } - - { _id: 1, routing: 4 } - - { _id: 1, routing: 5 } - - - is_false: docs.0.found - - is_false: docs.1.found - - - is_true: docs.2.found - - match: { docs.2._index: test_1 } - - match: { docs.2._type: test } - - match: { docs.2._id: "1" } - - match: { docs.2._routing: "5" } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml deleted file mode 100644 index 0cb7b71cf43..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/61_realtime_refresh_with_types.yml +++ /dev/null @@ -1,53 +0,0 @@ ---- -"Realtime Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - mget: - index: test_1 - type: test - realtime: false - body: - ids: [1] - - - is_false: docs.0.found - - - do: - mget: - index: test_1 - type: test - realtime: true - body: - ids: [1] - - - is_true: docs.0.found - - - do: - mget: - index: test_1 - type: test - realtime: false - refresh: true - body: - ids: [1] - - - is_true: docs.0.found diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml deleted file mode 100644 index 4581e060b41..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/71_source_filtering_with_types.yml +++ /dev/null @@ -1,119 +0,0 @@ -setup: - - do: - index: - index: test_1 - type: test - id: 1 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - - do: - index: - index: test_1 - type: test - id: 2 - body: { "include": { "field1": "v1", "field2": "v2" }, "count": 1 } - ---- -"Source filtering - true/false": - - - do: - mget: - body: - docs: - - { _index: "test_1", _type: "test", _id: "1", _source: false } - - { _index: "test_1", _type: "test", _id: "2", _source: true } - - - match: { docs.0._id: "1" } - - is_false: docs.0._source - - match: { docs.1._id: "2" } - - is_true: docs.1._source - ---- -"Source filtering - include field": - - - do: - mget: - body: - docs: - - { _index: "test_1", _type: "test", _id: "1", _source: include.field1 } - - { _index: "test_1", _type: "test", _id: "2", _source: [ include.field1 ] } - - - match: { docs.0._source: { include: { field1: v1 }} } - - match: { docs.1._source: { include: { field1: v1 }} } - - ---- -"Source filtering - include nested field": - - - do: - mget: - body: - docs: - - { _index: "test_1", _type: "test", _id: "1", _source: { include: include.field1 } } - - { _index: "test_1", _type: "test", _id: "2", _source: { include: [ include.field1 ] } } - - - match: { docs.0._source: { include: { field1: v1 }} } - - match: { docs.1._source: { include: { field1: v1 }} } - ---- -"Source filtering - exclude field": - - - do: - mget: - body: - docs: - - { _index: "test_1", _type: "test", _id: "1", _source: { include: [ include ], exclude: [ "*.field2" ] } } - - - match: { docs.0._source: { include: { field1: v1 }} } - ---- -"Source filtering - ids and true/false": - - - do: - mget: - _source: false - index: test_1 - body: { ids: [ 1,2 ] } - - is_false: docs.0._source - - is_false: docs.1._source - - - do: - mget: - _source: true - index: test_1 - body: { ids: [ 1,2 ] } - - is_true: docs.0._source - - is_true: docs.1._source - ---- -"Source filtering - ids and include field": - - - do: - mget: - _source: include.field1 - index: test_1 - body: { ids: [ 1,2 ] } - - match: { docs.0._source: { include: { field1: v1 }} } - - match: { docs.1._source: { include: { field1: v1 }} } - ---- -"Source filtering - ids and include nested field": - - - do: - mget: - _source_includes: "include.field1,count" - index: test_1 - body: { ids: [ 1,2 ] } - - match: { docs.0._source: { include: { field1: v1 }, count: 1} } - - match: { docs.1._source: { include: { field1: v1 }, count: 1} } - ---- -"Source filtering - ids and exclude field": - - - do: - mget: - _source_includes: include - _source_excludes: "*.field2" - index: test_1 - body: { ids: [ 1,2 ] } - - match: { docs.0._source: { include: { field1: v1 } } } - - match: { docs.1._source: { include: { field1: v1 } } } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml deleted file mode 100644 index 5033f75c794..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mget/80_deprecated_with_types.yml +++ /dev/null @@ -1,38 +0,0 @@ - ---- -"Deprecated parameters should fail in Multi Get query": - - - skip: - version: " - 6.99.99" - reason: _version, _routing are removed starting from 7.0, their equivalents without underscore are used instead - features: "warnings" - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - index: - index: test_1 - type: test - id: 2 - body: { foo: baz } - - - do: - catch: bad_request - mget: - body: - docs: - - { _index: test_1, _type: test, _id: 1, _routing : test1 } - - { _index: test_1, _type: test, _id: 2, _routing : test1 } - - - do: - catch: bad_request - mget: - body: - docs: - - { _index: test_1, _type: test, _id: 1, _version : 1 } - - { _index: test_1, _type: test, _id: 2, _version : 1 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/msearch/12_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/msearch/12_basic_with_types.yml deleted file mode 100644 index 64e88de404a..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/msearch/12_basic_with_types.yml +++ /dev/null @@ -1,97 +0,0 @@ ---- -setup: - - - do: - index: - index: index_1 - type: test - id: 1 - body: { foo: bar } - - - do: - index: - index: index_1 - type: test - id: 2 - body: { foo: baz } - - - do: - index: - index: index_1 - type: test - id: 3 - body: { foo: foo } - - - do: - index: - index: index_2 - type: test - id: 1 - body: { foo: foo } - - - do: - indices.refresh: {} - ---- -"Basic multi-search": - - - do: - msearch: - rest_total_hits_as_int: true - body: - - index: index_* - - query: - match: {foo: foo} - - index: index_2 - - query: - match_all: {} - - index: index_1 - - query: - match: {foo: foo} - - index: index_3 - - query: - match_all: {} - - type: test - - query: - match_all: {} - - - match: { responses.0.hits.total: 2 } - - match: { responses.1.hits.total: 1 } - - match: { responses.2.hits.total: 1 } - - match: { responses.3.error.root_cause.0.type: index_not_found_exception } - - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } - - match: { responses.3.error.root_cause.0.index: index_3 } - - match: { responses.4.hits.total: 4 } - ---- -"Least impact smoke test": -# only passing these parameters to make sure they are consumed - - do: - msearch: - rest_total_hits_as_int: true - max_concurrent_shard_requests: 1 - max_concurrent_searches: 1 - body: - - index: index_* - - query: - match: {foo: foo} - - index: index_2 - - query: - match_all: {} - - index: index_1 - - query: - match: {foo: foo} - - index: index_3 - - query: - match_all: {} - - type: test - - query: - match_all: {} - - - match: { responses.0.hits.total: 2 } - - match: { responses.1.hits.total: 1 } - - match: { responses.2.hits.total: 1 } - - match: { responses.3.error.root_cause.0.type: index_not_found_exception } - - match: { responses.3.error.root_cause.0.reason: "/no.such.index/" } - - match: { responses.3.error.root_cause.0.index: index_3 } - - match: { responses.4.hits.total: 4 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml deleted file mode 100644 index 0c037eee9dd..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml +++ /dev/null @@ -1,86 +0,0 @@ -setup: - - do: - indices.create: - include_type_name: true - index: testidx - body: - mappings: - testtype: - properties: - text: - type : "text" - term_vector : "with_positions_offsets" - - do: - index: - index: testidx - type: testtype - id: testing_document - body: {"text" : "The quick brown fox is brown."} - - - do: - indices.refresh: {} - ---- -"Basic tests for multi termvector get": - - - do: - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_type" : "testtype" - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_type" : "testtype" - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "index" : "testidx" - "body" : - "docs": - - - "_type" : "testtype" - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "index" : "testidx" - "type" : "testtype" - "body" : - "docs": - - - "_id" : "testing_document" - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} - - - do: - mtermvectors: - "term_statistics" : true - "index" : "testidx" - "type" : "testtype" - "ids" : ["testing_document"] - - - match: {docs.0.term_vectors.text.terms.brown.term_freq: 2} - - match: {docs.0.term_vectors.text.terms.brown.ttf: 2} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml deleted file mode 100644 index b0335498e22..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml +++ /dev/null @@ -1,53 +0,0 @@ - ---- -"Deprecated camel case and _ parameters should fail in Term Vectors query": - - - skip: - version: " - 6.99.99" - reason: camel case and _ parameters (e.g. versionType, _version_type) should fail from 7.0 - features: "warnings" - - - do: - indices.create: - include_type_name: true - index: testidx - body: - mappings: - testtype: - properties: - text: - type : "text" - term_vector : "with_positions_offsets" - - - do: - index: - index: testidx - type: testtype - id: testing_document - body: {"text" : "The quick brown fox is brown."} - - - do: - catch: bad_request - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_type" : "testtype" - "_id" : "testing_document" - "version" : 1 - "versionType" : "external" - - - do: - catch: bad_request - mtermvectors: - "term_statistics" : true - "body" : - "docs": - - - "_index" : "testidx" - "_type" : "testtype" - "_id" : "testing_document" - "version" : 1 - "_version_type" : "external" diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml deleted file mode 100644 index 54476ce6e65..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/search.aggregation/51_filter_with_types.yml +++ /dev/null @@ -1,60 +0,0 @@ -setup: - - do: - indices.create: - include_type_name: true - index: test - body: - settings: - number_of_shards: 1 - number_of_replicas: 0 - mappings: - test: - properties: - mentions: - type: keyword - notifications: - type: keyword - - - do: - index: - index: test - type: test - id: foo|bar|baz0 - body: { "notifications" : ["abc"] } - - - do: - index: - index: test - type: test - id: foo|bar|baz1 - body: { "mentions" : ["abc"] } - - - do: - indices.refresh: {} - ---- -"Filter aggs with terms lookup and ensure it's cached": - # Because the filter agg rewrites the terms lookup in the rewrite phase the request can be cached - - skip: - features: allowed_warnings - - do: - allowed_warnings: - - "Deprecated field [type] used, this field is unused and will be removed entirely" - search: - rest_total_hits_as_int: true - size: 0 - request_cache: true - body: {"aggs": { "itemsNotify": { "filter": { "terms": { "mentions": { "index": "test", "type": "test", "id": "foo|bar|baz0", "path": "notifications"}}}, "aggs": { "mentions" : {"terms" : { "field" : "mentions" }}}}}} - - # validate result - - match: { hits.total: 2 } - - match: { aggregations.itemsNotify.doc_count: 1 } - - length: { aggregations.itemsNotify.mentions.buckets: 1 } - - match: { aggregations.itemsNotify.mentions.buckets.0.key: "abc" } - # we are using a lookup - this should not cache - - do: - indices.stats: { index: test, metric: request_cache} - - match: { _shards.total: 1 } - - match: { _all.total.request_cache.hit_count: 0 } - - match: { _all.total.request_cache.miss_count: 1 } - - is_true: indices.test diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml deleted file mode 100644 index 992d6db7ca7..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml +++ /dev/null @@ -1,36 +0,0 @@ -setup: - - do: - indices.create: - include_type_name: true - index: testidx - body: - mappings: - testtype: - "properties": - "text": - "type" : "text" - "term_vector" : "with_positions_offsets" - - do: - index: - index: testidx - type: testtype - id: testing_document - body: - "text" : "The quick brown fox is brown." - - do: - indices.refresh: {} - ---- -"Basic tests for termvector get": - - - do: - termvectors: - index: testidx - type: testtype - id: testing_document - "term_statistics" : true - - - - match: {term_vectors.text.field_statistics.sum_doc_freq: 5} - - match: {term_vectors.text.terms.brown.doc_freq: 1} - - match: {term_vectors.text.terms.brown.tokens.0.start_offset: 10} diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml deleted file mode 100644 index cf597bf141f..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml +++ /dev/null @@ -1,42 +0,0 @@ -"Term vector API should return 'found: false' for docs between index and refresh": - - do: - indices.create: - include_type_name: true - index: testidx - body: - settings: - index: - translog.flush_threshold_size: "512MB" - number_of_shards: 1 - number_of_replicas: 0 - refresh_interval: -1 - mappings: - doc: - properties: - text: - type : "text" - term_vector : "with_positions_offsets" - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: testidx - type: doc - id: 1 - body: - text : "foo bar" - - - do: - termvectors: - index: testidx - type: doc - id: 1 - realtime: false - - - match: { _index: "testidx" } - - match: { _type: "doc" } - - match: { _id: "1" } - - is_false: found diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml deleted file mode 100644 index 26f441207ac..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml +++ /dev/null @@ -1,40 +0,0 @@ ---- -"Realtime Term Vectors": - - - do: - indices.create: - index: test_1 - body: - settings: - index: - refresh_interval: -1 - number_of_replicas: 0 - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: test_1 - type: test - id: 1 - body: { foo: bar } - - - do: - termvectors: - index: test_1 - type: test - id: 1 - realtime: false - - - is_false: found - - - do: - termvectors: - index: test_1 - type: test - id: 1 - realtime: true - - - is_true: found diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml deleted file mode 100644 index 4382442dee4..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml +++ /dev/null @@ -1,46 +0,0 @@ ---- -"Term vectors with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "text" - term_vector: "with_positions" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - indices.refresh: {} - - - do: - termvectors: - index: index - type: _doc # todo: remove when termvectors support typeless API - id: 1 - - - is_true: found - - match: {_type: _doc} - - match: {term_vectors.foo.terms.bar.term_freq: 1} - - - do: - termvectors: - index: index - type: some_random_type - id: 1 - - - is_false: found diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/14_shard_header_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/14_shard_header_with_types.yml deleted file mode 100644 index eb2e4ff9a91..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/14_shard_header_with_types.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -"Update check shard header": - - - do: - indices.create: - index: foobar - body: - settings: - number_of_shards: "1" - number_of_replicas: "0" - - - do: - cluster.health: - wait_for_status: green - - - do: - index: - index: foobar - type: baz - id: 1 - body: { foo: bar } - - - do: - update: - index: foobar - type: baz - id: 1 - body: - doc: - foo: baz - - - match: { _index: foobar } - - match: { _type: baz } - - match: { _id: "1"} - - match: { _version: 2} - - match: { _shards.total: 1} - - match: { _shards.successful: 1} - - match: { _shards.failed: 0} - - is_false: _shards.pending diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/16_noop.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/16_noop.yml index bfb56541fb7..dfdf2a10c84 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/16_noop.yml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/update/16_noop.yml @@ -6,7 +6,6 @@ - do: index: index: test_1 - type: test id: 1 body: { foo: bar } @@ -18,7 +17,6 @@ - do: update: index: test_1 - type: test id: 1 body: doc: { foo: bar } @@ -31,7 +29,6 @@ - do: update: index: test_1 - type: test id: 1 body: doc: { foo: bar } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/61_refresh_with_types.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/61_refresh_with_types.yml deleted file mode 100644 index be2d9f9f796..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/61_refresh_with_types.yml +++ /dev/null @@ -1,115 +0,0 @@ ---- -"Refresh": - - - do: - indices.create: - index: test_1 - body: - settings: - index.refresh_interval: -1 - number_of_replicas: 0 - - - do: - update: - index: test_1 - type: test - id: 1 - body: - doc: { foo: baz } - upsert: { foo: bar } - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 1 }} - - - match: { hits.total: 0 } - - - do: - update: - index: test_1 - type: test - id: 2 - refresh: true - body: - doc: { foo: baz } - upsert: { foo: bar } - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { _id: 2 }} - - - match: { hits.total: 1 } - ---- -"When refresh url parameter is an empty string that means \"refresh immediately\"": - - do: - index: - index: test_1 - type: test - id: 1 - refresh: true - body: { foo: bar } - - is_true: forced_refresh - - - do: - update: - index: test_1 - type: test - id: 1 - refresh: "" - body: - doc: {cat: dog} - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: test_1 - body: - query: { term: { cat: dog }} - - - match: { hits.total: 1 } - ---- -"refresh=wait_for waits until changes are visible in search": - - do: - index: - index: update_60_refresh_1 - type: test - id: update_60_refresh_id1 - body: { foo: bar } - refresh: true - - is_true: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: update_60_refresh_1 - body: - query: { term: { _id: update_60_refresh_id1 }} - - match: { hits.total: 1 } - - - do: - update: - index: update_60_refresh_1 - type: test - id: update_60_refresh_id1 - refresh: wait_for - body: - doc: { test: asdf } - - is_false: forced_refresh - - - do: - search: - rest_total_hits_as_int: true - index: update_60_refresh_1 - body: - query: { match: { test: asdf } } - - match: { hits.total: 1 } diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml b/rest-api-spec/src/main/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml deleted file mode 100644 index 0ca25e8598c..00000000000 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/update/90_mix_typeless_typeful.yml +++ /dev/null @@ -1,86 +0,0 @@ ---- -"Update with typeless API on an index that has types": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - update: - index: index - id: 1 - body: - doc: - foo: baz - - - do: - get: - index: index - type: not_doc - id: 1 - - - match: { _source.foo: baz } - ---- -"Update call that introduces new field mappings": - - - skip: - version: " - 6.99.99" - reason: Typeless APIs were introduced in 7.0.0 - - - do: - indices.create: # not using include_type_name: false on purpose - include_type_name: true - index: index - body: - mappings: - not_doc: - properties: - foo: - type: "keyword" - - - do: - index: - index: index - type: not_doc - id: 1 - body: { foo: bar } - - - do: - update: - index: index - id: 1 - body: - doc: - foo: baz - new_field: value - - do: - get: # using typeful API on purpose - index: index - type: not_doc - id: 1 - - - match: { _index: "index" } - - match: { _type: "not_doc" } - - match: { _id: "1" } - - match: { _version: 2} - - match: { _source.foo: baz } - - match: { _source.new_field: value } diff --git a/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java b/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java index f3ffe0cdee0..07e4723d352 100644 --- a/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java +++ b/server/src/main/java/org/opensearch/rest/action/document/RestIndexAction.java @@ -38,9 +38,7 @@ import org.opensearch.action.index.IndexRequest; import org.opensearch.action.support.ActiveShardCount; import org.opensearch.client.node.NodeClient; import org.opensearch.cluster.node.DiscoveryNodes; -import org.opensearch.common.logging.DeprecationLogger; import org.opensearch.index.VersionType; -import org.opensearch.index.mapper.MapperService; import org.opensearch.rest.BaseRestHandler; import org.opensearch.rest.RestRequest; import org.opensearch.rest.action.RestActions; @@ -57,21 +55,10 @@ import static org.opensearch.rest.RestRequest.Method.POST; import static org.opensearch.rest.RestRequest.Method.PUT; public class RestIndexAction extends BaseRestHandler { - private static final DeprecationLogger deprecationLogger = DeprecationLogger.getLogger(RestDeleteAction.class); - public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] Specifying types in document " - + "index requests is deprecated, use the typeless endpoints instead (/{index}/_doc/{id}, /{index}/_doc, " - + "or /{index}/_create/{id})."; @Override public List routes() { - return unmodifiableList( - asList( - new Route(POST, "/{index}/_doc/{id}"), - new Route(PUT, "/{index}/_doc/{id}"), - new Route(POST, "/{index}/{type}/{id}"), - new Route(PUT, "/{index}/{type}/{id}") - ) - ); + return unmodifiableList(asList(new Route(POST, "/{index}/_doc/{id}"), new Route(PUT, "/{index}/_doc/{id}"))); } @Override @@ -88,14 +75,7 @@ public class RestIndexAction extends BaseRestHandler { @Override public List routes() { - return unmodifiableList( - asList( - new Route(POST, "/{index}/_create/{id}"), - new Route(PUT, "/{index}/_create/{id}"), - new Route(POST, "/{index}/{type}/{id}/_create"), - new Route(PUT, "/{index}/{type}/{id}/_create") - ) - ); + return unmodifiableList(asList(new Route(POST, "/{index}/_create/{id}"), new Route(PUT, "/{index}/_create/{id}"))); } @Override @@ -127,7 +107,7 @@ public class RestIndexAction extends BaseRestHandler { @Override public List routes() { - return unmodifiableList(asList(new Route(POST, "/{index}/_doc"), new Route(POST, "/{index}/{type}"))); + return unmodifiableList(asList(new Route(POST, "/{index}/_doc"))); } @Override @@ -145,13 +125,8 @@ public class RestIndexAction extends BaseRestHandler { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { IndexRequest indexRequest; final String type = request.param("type"); - if (type != null && type.equals(MapperService.SINGLE_MAPPING_NAME) == false) { - deprecationLogger.deprecate("index_with_types", TYPES_DEPRECATION_MESSAGE); - indexRequest = new IndexRequest(request.param("index"), type, request.param("id")); - } else { - indexRequest = new IndexRequest(request.param("index")); - indexRequest.id(request.param("id")); - } + indexRequest = new IndexRequest(request.param("index")); + indexRequest.id(request.param("id")); indexRequest.routing(request.param("routing")); indexRequest.setPipeline(request.param("pipeline")); indexRequest.source(request.requiredContent(), request.getXContentType()); diff --git a/server/src/test/java/org/opensearch/rest/action/document/RestIndexActionTests.java b/server/src/test/java/org/opensearch/rest/action/document/RestIndexActionTests.java index 021563d2329..5a1d43ff5dd 100644 --- a/server/src/test/java/org/opensearch/rest/action/document/RestIndexActionTests.java +++ b/server/src/test/java/org/opensearch/rest/action/document/RestIndexActionTests.java @@ -67,26 +67,14 @@ public class RestIndexActionTests extends RestActionTestCase { controller().registerHandler(new AutoIdHandler(() -> clusterStateSupplier.get().nodes())); } - public void testTypeInPath() { - RestRequest deprecatedRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT) - .withPath("/some_index/some_type/some_id") - .build(); - dispatchRequest(deprecatedRequest); - assertWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE); - + public void testPath() { RestRequest validRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT) .withPath("/some_index/_doc/some_id") .build(); dispatchRequest(validRequest); } - public void testCreateWithTypeInPath() { - RestRequest deprecatedRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT) - .withPath("/some_index/some_type/some_id/_create") - .build(); - dispatchRequest(deprecatedRequest); - assertWarnings(RestIndexAction.TYPES_DEPRECATION_MESSAGE); - + public void testCreatePath() { RestRequest validRequest = new FakeRestRequest.Builder(xContentRegistry()).withMethod(RestRequest.Method.PUT) .withPath("/some_index/_create/some_id") .build(); diff --git a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java index 79980ccc392..9603b633378 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/OpenSearchRestTestCase.java @@ -727,7 +727,8 @@ public abstract class OpenSearchRestTestCase extends OpenSearchTestCase { Response response = adminClient().performRequest(new Request("GET", "/_slm/policy")); policies = entityAsMap(response); } catch (ResponseException e) { - if (RestStatus.METHOD_NOT_ALLOWED.getStatus() == e.getResponse().getStatusLine().getStatusCode()) { + if (RestStatus.METHOD_NOT_ALLOWED.getStatus() == e.getResponse().getStatusLine().getStatusCode() + || RestStatus.BAD_REQUEST.getStatus() == e.getResponse().getStatusLine().getStatusCode()) { // If bad request returned, SLM is not enabled. return; } diff --git a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java index db8deb55ae5..375103d2c1d 100644 --- a/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java +++ b/test/framework/src/main/java/org/opensearch/test/rest/yaml/OpenSearchClientYamlSuiteTestCase.java @@ -75,7 +75,7 @@ import java.util.Set; /** * Runs a suite of yaml tests shared with all the official OpenSearch - * clients against against an opensearch cluster. + * clients against an opensearch cluster. * * The suite timeout is extended to account for projects with a large number of tests. */