浏览代码

Removes typed REST endpoints from search and related APIs (#41640)

Colin Goodheart-Smithe 6 年之前
父节点
当前提交
3647d7c94e
共有 34 个文件被更改,包括 72 次插入1104 次删除
  1. 6 1
      docs/reference/migration/migrate_8_0/reindex.asciidoc
  2. 10 0
      docs/reference/migration/migrate_8_0/search.asciidoc
  3. 0 18
      modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java
  4. 0 4
      modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java
  5. 0 66
      modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionTests.java
  6. 0 61
      modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionTests.java
  7. 0 1
      modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryAction.java
  8. 0 1
      modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryAction.java
  9. 0 64
      modules/reindex/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionTests.java
  10. 0 65
      modules/reindex/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java
  11. 0 11
      rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json
  12. 0 11
      rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json
  13. 0 11
      rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json
  14. 0 11
      rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json
  15. 0 11
      rest-api-spec/src/main/resources/rest-api-spec/api/search.json
  16. 0 11
      rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json
  17. 0 17
      rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json
  18. 0 11
      rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json
  19. 0 86
      rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml
  20. 0 51
      rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml
  21. 0 29
      rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml
  22. 0 36
      rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml
  23. 0 42
      rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml
  24. 0 40
      rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml
  25. 0 42
      rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml
  26. 2 16
      server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java
  27. 2 21
      server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java
  28. 1 20
      server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java
  29. 0 14
      server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java
  30. 0 87
      server/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionTests.java
  31. 0 67
      server/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionTests.java
  32. 0 66
      server/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionTests.java
  33. 0 61
      server/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionTests.java
  34. 51 51
      x-pack/plugin/security/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java

+ 6 - 1
docs/reference/migration/migrate_8_0/reindex.asciidoc

@@ -7,4 +7,9 @@ re-encode them when generating the search request for the remote host. This
 leniency has been removed such that all index-names are correctly encoded when
 reindex generates remote search requests.
 
-Instead, please specify the index-name without any encoding.
+Instead, please specify the index-name without any encoding.
+
+[float]
+==== Removal of types
+
+The `/{index}/{type}/_delete_by_query` and `/{index}/{type}/_update_by_query` REST endpoints have been removed in favour of `/{index}/_delete_by_query` and `/{index}/_update_by_query`, since indexes no longer contain types, these typed endpoints are obsolete.

+ 10 - 0
docs/reference/migration/migrate_8_0/search.asciidoc

@@ -0,0 +1,10 @@
+[float]
+[[breaking_80_search_changes]]
+=== Search Changes
+
+[float]
+==== Removal of types
+
+The `/{index}/{type}/_search`, `/{index}/{type}/_msearch`, `/{index}/{type}/_search/template` and `/{index}/{type}/_msearch/template` REST endpoints have been removed in favour of `/{index}/_search`, `/{index}/_msearch`, `/{index}/_search/template` and `/{index}/_msearch/template`, since indexes no longer contain types, these typed endpoints are obsolete..
+
+The `/{index}/{type}/_termvectors`, `/{index}/{type}/{id}/_termvectors` and `/{index}/{type}/_mtermvectors` REST endpoints have been removed in favour of `/{index}/_termvectors`, `/{index}/{id}/_termvectors` and `/{index}/_mtermvectors`, since indexes no longer contain types, these typed endpoints are obsolete..

+ 0 - 18
modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateAction.java

@@ -19,9 +19,7 @@
 
 package org.elasticsearch.script.mustache;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.client.node.NodeClient;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.rest.BaseRestHandler;
 import org.elasticsearch.rest.RestController;
@@ -40,10 +38,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
 import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestMultiSearchTemplateAction extends BaseRestHandler {
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
-        LogManager.getLogger(RestMultiSearchTemplateAction.class));
-    static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" +
-        " Specifying types in multi search template requests is deprecated.";
 
     private static final Set<String> RESPONSE_PARAMS;
 
@@ -65,10 +59,6 @@ public class RestMultiSearchTemplateAction extends BaseRestHandler {
         controller.registerHandler(POST, "/_msearch/template", this);
         controller.registerHandler(GET, "/{index}/_msearch/template", this);
         controller.registerHandler(POST, "/{index}/_msearch/template", this);
-
-        // Deprecated typed endpoints.
-        controller.registerHandler(GET, "/{index}/{type}/_msearch/template", this);
-        controller.registerHandler(POST, "/{index}/{type}/_msearch/template", this);
     }
 
     @Override
@@ -79,14 +69,6 @@ public class RestMultiSearchTemplateAction extends BaseRestHandler {
     @Override
     public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException {
         MultiSearchTemplateRequest multiRequest = parseRequest(request, allowExplicitIndex);
-
-        // Emit a single deprecation message if any search template contains types.
-        for (SearchTemplateRequest searchTemplateRequest : multiRequest.requests()) {
-            if (searchTemplateRequest.getRequest().types().length > 0) {
-                deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE);
-                break;
-            }
-        }
         return channel -> client.execute(MultiSearchTemplateAction.INSTANCE, multiRequest, new RestToXContentListener<>(channel));
     }
 

+ 0 - 4
modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/RestSearchTemplateAction.java

@@ -54,10 +54,6 @@ public class RestSearchTemplateAction extends BaseRestHandler {
         controller.registerHandler(POST, "/_search/template", this);
         controller.registerHandler(GET, "/{index}/_search/template", this);
         controller.registerHandler(POST, "/{index}/_search/template", this);
-
-        // Deprecated typed endpoints.
-        controller.registerHandler(GET, "/{index}/{type}/_search/template", this);
-        controller.registerHandler(POST, "/{index}/{type}/_search/template", this);
     }
 
     @Override

+ 0 - 66
modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/RestMultiSearchTemplateActionTests.java

@@ -1,66 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.elasticsearch.script.mustache;
-
-import org.elasticsearch.common.bytes.BytesArray;
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.common.xcontent.XContentType;
-import org.elasticsearch.rest.RestRequest;
-import org.elasticsearch.test.rest.FakeRestRequest;
-import org.elasticsearch.test.rest.RestActionTestCase;
-import org.junit.Before;
-
-import java.nio.charset.StandardCharsets;
-
-public class RestMultiSearchTemplateActionTests extends RestActionTestCase {
-
-    @Before
-    public void setUpAction() {
-        new RestMultiSearchTemplateAction(Settings.EMPTY, controller());
-    }
-
-    public void testTypeInPath() {
-        String content = "{ \"index\": \"some_index\" } \n" +
-            "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n";
-        BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8));
-
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(RestRequest.Method.GET)
-            .withPath("/some_index/some_type/_msearch/template")
-            .withContent(bytesContent, XContentType.JSON)
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestMultiSearchTemplateAction.TYPES_DEPRECATION_MESSAGE);
-    }
-
-    public void testTypeInBody() {
-        String content = "{ \"index\": \"some_index\", \"type\": \"some_type\" } \n" +
-            "{\"source\": {\"query\" : {\"match_all\" :{}}}} \n";
-        BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8));
-
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withPath("/some_index/_msearch/template")
-            .withContent(bytesContent, XContentType.JSON)
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestMultiSearchTemplateAction.TYPES_DEPRECATION_MESSAGE);
-    }
-}

+ 0 - 61
modules/lang-mustache/src/test/java/org/elasticsearch/script/mustache/RestSearchTemplateActionTests.java

@@ -1,61 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.elasticsearch.script.mustache;
-
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.rest.RestRequest;
-import org.elasticsearch.rest.action.search.RestSearchAction;
-import org.elasticsearch.test.rest.FakeRestRequest;
-import org.elasticsearch.test.rest.RestActionTestCase;
-import org.junit.Before;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class RestSearchTemplateActionTests extends RestActionTestCase {
-
-    @Before
-    public void setUpAction() {
-        new RestSearchTemplateAction(Settings.EMPTY, controller());
-    }
-
-    public void testTypeInPath() {
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(RestRequest.Method.GET)
-            .withPath("/some_index/some_type/_search/template")
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestSearchAction.TYPES_DEPRECATION_MESSAGE);
-    }
-
-    public void testTypeParameter() {
-        Map<String, String> params = new HashMap<>();
-        params.put("type", "some_type");
-
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(RestRequest.Method.GET)
-            .withPath("/some_index/_search/template")
-            .withParams(params)
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestSearchAction.TYPES_DEPRECATION_MESSAGE);
-    }
-}

+ 0 - 1
modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestDeleteByQueryAction.java

@@ -35,7 +35,6 @@ public class RestDeleteByQueryAction extends AbstractBulkByQueryRestHandler<Dele
     public RestDeleteByQueryAction(Settings settings, RestController controller) {
         super(settings, DeleteByQueryAction.INSTANCE);
         controller.registerHandler(POST, "/{index}/_delete_by_query", this);
-        controller.registerHandler(POST, "/{index}/{type}/_delete_by_query", this);
     }
 
     @Override

+ 0 - 1
modules/reindex/src/main/java/org/elasticsearch/index/reindex/RestUpdateByQueryAction.java

@@ -42,7 +42,6 @@ public class RestUpdateByQueryAction extends AbstractBulkByQueryRestHandler<Upda
     public RestUpdateByQueryAction(Settings settings, RestController controller) {
         super(settings, UpdateByQueryAction.INSTANCE);
         controller.registerHandler(POST, "/{index}/_update_by_query", this);
-        controller.registerHandler(POST, "/{index}/{type}/_update_by_query", this);
     }
 
     @Override

+ 0 - 64
modules/reindex/src/test/java/org/elasticsearch/index/reindex/RestDeleteByQueryActionTests.java

@@ -1,64 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.elasticsearch.index.reindex;
-
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.common.xcontent.NamedXContentRegistry;
-import org.elasticsearch.rest.RestRequest;
-import org.elasticsearch.rest.action.search.RestSearchAction;
-import org.elasticsearch.test.rest.FakeRestRequest;
-import org.elasticsearch.test.rest.RestActionTestCase;
-
-import org.junit.Before;
-import java.io.IOException;
-
-import static java.util.Collections.emptyList;
-
-public class RestDeleteByQueryActionTests extends RestActionTestCase {
-    private RestDeleteByQueryAction action;
-
-    @Before
-    public void setUpAction() {
-        action = new RestDeleteByQueryAction(Settings.EMPTY, controller());
-    }
-
-    public void testTypeInPath() throws IOException {
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(RestRequest.Method.POST)
-            .withPath("/some_index/some_type/_delete_by_query")
-            .build();
-        dispatchRequest(request);
-
-        // checks the type in the URL is propagated correctly to the request object
-        // only works after the request is dispatched, so its params are filled from url.
-        DeleteByQueryRequest dbqRequest = action.buildRequest(request);
-        assertArrayEquals(new String[]{"some_type"}, dbqRequest.getDocTypes());
-
-        // RestDeleteByQueryAction itself doesn't check for a deprecated type usage
-        // checking here for a deprecation from its internal search request
-        assertWarnings(RestSearchAction.TYPES_DEPRECATION_MESSAGE);
-    }
-
-    public void testParseEmpty() throws IOException {
-        DeleteByQueryRequest request = action.buildRequest(new FakeRestRequest.Builder(new NamedXContentRegistry(emptyList())).build());
-        assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize());
-        assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size());
-    }
-}

+ 0 - 65
modules/reindex/src/test/java/org/elasticsearch/index/reindex/RestUpdateByQueryActionTests.java

@@ -1,65 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.elasticsearch.index.reindex;
-
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.common.xcontent.NamedXContentRegistry;
-import org.elasticsearch.rest.RestRequest;
-import org.elasticsearch.rest.action.search.RestSearchAction;
-import org.elasticsearch.test.rest.FakeRestRequest;
-import org.elasticsearch.test.rest.RestActionTestCase;
-
-import org.junit.Before;
-import java.io.IOException;
-
-import static java.util.Collections.emptyList;
-
-public class RestUpdateByQueryActionTests extends RestActionTestCase {
-
-    private RestUpdateByQueryAction action;
-
-    @Before
-    public void setUpAction() {
-        action = new RestUpdateByQueryAction(Settings.EMPTY, controller());
-    }
-
-    public void testTypeInPath() throws IOException  {
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(RestRequest.Method.POST)
-            .withPath("/some_index/some_type/_update_by_query")
-            .build();
-        dispatchRequest(request);
-
-        // checks the type in the URL is propagated correctly to the request object
-        // only works after the request is dispatched, so its params are filled from url.
-        UpdateByQueryRequest ubqRequest = action.buildRequest(request);
-        assertArrayEquals(new String[]{"some_type"}, ubqRequest.getDocTypes());
-
-        // RestUpdateByQueryAction itself doesn't check for a deprecated type usage
-        // checking here for a deprecation from its internal search request
-        assertWarnings(RestSearchAction.TYPES_DEPRECATION_MESSAGE);
-    }
-
-    public void testParseEmpty() throws IOException {
-        UpdateByQueryRequest request = action.buildRequest(new FakeRestRequest.Builder(new NamedXContentRegistry(emptyList())).build());
-        assertEquals(AbstractBulkByScrollRequest.SIZE_ALL_MATCHES, request.getSize());
-        assertEquals(AbstractBulkByScrollRequest.DEFAULT_SCROLL_SIZE, request.getSearchRequest().source().size());
-    }
-}

+ 0 - 11
rest-api-spec/src/main/resources/rest-api-spec/api/delete_by_query.json

@@ -5,23 +5,12 @@
     "url": {
       "path": "/{index}/_delete_by_query",
       "paths": ["/{index}/_delete_by_query"],
-      "deprecated_paths" : [
-        {
-          "version" : "7.0.0",
-          "path" : "/{index}/{type}/_delete_by_query",
-          "description" : "Specifying types in urls has been deprecated"
-        }
-      ],
       "comment": "most things below this are just copied from search.json",
       "parts": {
         "index": {
          "required" : true,
          "type" : "list",
          "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"
-        },
-        "type": {
-          "type" : "list",
-          "description" : "A comma-separated list of document types to search; leave empty to perform the operation on all types"
         }
       },
       "params": {

+ 0 - 11
rest-api-spec/src/main/resources/rest-api-spec/api/msearch.json

@@ -5,21 +5,10 @@
     "url": {
       "path": "/_msearch",
       "paths": ["/_msearch", "/{index}/_msearch"],
-      "deprecated_paths" : [
-        {
-          "version" : "7.0.0",
-          "path" : "/{index}/{type}/_msearch",
-          "description" : "Specifying types in urls has been deprecated"
-        }
-      ],
       "parts": {
         "index": {
          "type" : "list",
          "description" : "A comma-separated list of index names to use as default"
-        },
-        "type": {
-          "type" : "list",
-          "description" : "A comma-separated list of document types to use as default"
         }
       },
       "params": {

+ 0 - 11
rest-api-spec/src/main/resources/rest-api-spec/api/msearch_template.json

@@ -5,21 +5,10 @@
     "url": {
       "path": "/_msearch/template",
       "paths": ["/_msearch/template", "/{index}/_msearch/template"],
-      "deprecated_paths" : [
-        {
-          "version" : "7.0.0",
-          "path" : "/{index}/{type}/_msearch/template",
-          "description" : "Specifying types in urls has been deprecated"
-        }
-      ],
       "parts": {
         "index": {
           "type" : "list",
           "description" : "A comma-separated list of index names to use as default"
-        },
-        "type": {
-          "type" : "list",
-          "description" : "A comma-separated list of document types to use as default"
         }
       },
       "params": {

+ 0 - 11
rest-api-spec/src/main/resources/rest-api-spec/api/mtermvectors.json

@@ -5,21 +5,10 @@
     "url" : {
       "path" : "/_mtermvectors",
       "paths" : ["/_mtermvectors", "/{index}/_mtermvectors"],
-      "deprecated_paths" : [
-        {
-          "version" : "7.0.0",
-          "path" : "/{index}/{type}/_mtermvectors",
-          "description" : "Specifying types in urls has been deprecated"
-        }
-      ],
       "parts" : {
         "index" : {
          "type" : "string",
          "description" : "The index in which the document resides."
-        },
-        "type" : {
-          "type" : "string",
-          "description" : "The type of the document."
         }
       },
       "params" : {

+ 0 - 11
rest-api-spec/src/main/resources/rest-api-spec/api/search.json

@@ -5,21 +5,10 @@
     "url": {
       "path": "/_search",
       "paths": ["/_search", "/{index}/_search"],
-      "deprecated_paths" : [
-        {
-          "version" : "7.0.0",
-          "path" : "/{index}/{type}/_search",
-          "description" : "Specifying types in urls has been deprecated"
-        }
-      ],
       "parts": {
         "index": {
          "type" : "list",
          "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"
-        },
-        "type": {
-          "type" : "list",
-          "description" : "A comma-separated list of document types to search; leave empty to perform the operation on all types"
         }
       },
       "params": {

+ 0 - 11
rest-api-spec/src/main/resources/rest-api-spec/api/search_template.json

@@ -5,21 +5,10 @@
     "url": {
       "path": "/_search/template",
       "paths": ["/_search/template", "/{index}/_search/template"],
-      "deprecated_paths" : [
-        {
-          "version" : "7.0.0",
-          "path" : "/{index}/{type}/_search/template",
-          "description" : "Specifying types in urls has been deprecated"
-        }
-      ],
       "parts": {
         "index": {
           "type" : "list",
           "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"
-        },
-        "type": {
-          "type" : "list",
-          "description" : "A comma-separated list of document types to search; leave empty to perform the operation on all types"
         }
       },
       "params" : {

+ 0 - 17
rest-api-spec/src/main/resources/rest-api-spec/api/termvectors.json

@@ -5,29 +5,12 @@
     "url" : {
       "path" : "/{index}/_termvectors/{id}",
       "paths" : ["/{index}/_termvectors/{id}", "/{index}/_termvectors"],
-      "deprecated_paths" : [
-        {
-          "version" : "7.0.0",
-          "path" : "/{index}/{type}/{id}/_termvectors",
-          "description" : "Specifying types in urls has been deprecated"
-        },
-        {
-          "version" : "7.0.0",
-          "path" : "/{index}/{type}/_termvectors",
-          "description" : "Specifying types in urls has been deprecated"
-        }
-      ],
       "parts" : {
         "index" : {
          "type" : "string",
          "description" : "The index in which the document resides.",
          "required" : true
         },
-        "type" : {
-          "type" : "string",
-          "description" : "The type of the document.",
-          "required" : false
-        },
         "id" : {
            "type" : "string",
            "description" : "The id of the document, when not specified a doc param should be supplied."

+ 0 - 11
rest-api-spec/src/main/resources/rest-api-spec/api/update_by_query.json

@@ -5,23 +5,12 @@
     "url": {
       "path": "/{index}/_update_by_query",
       "paths": ["/{index}/_update_by_query"],
-      "deprecated_paths" : [
-        {
-          "version" : "7.0.0",
-          "path" : "/{index}/{type}/_update_by_query",
-          "description" : "Specifying types in urls has been deprecated"
-        }
-      ],
       "comment": "most things below this are just copied from search.json",
       "parts": {
         "index": {
          "required" : true,
          "type" : "list",
          "description" : "A comma-separated list of index names to search; use `_all` or empty string to perform the operation on all indices"
-        },
-        "type": {
-          "type" : "list",
-          "description" : "A comma-separated list of document types to search; leave empty to perform the operation on all types"
         }
       },
       "params": {

+ 0 - 86
rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/11_basic_with_types.yml

@@ -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}

+ 0 - 51
rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/21_deprecated_with_types.yml

@@ -1,51 +0,0 @@
-
----
-"Deprecated camel case and _ parameters should fail in Term Vectors query":
-
-   - skip:
-       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"

+ 0 - 29
rest-api-spec/src/main/resources/rest-api-spec/test/mtermvectors/30_mix_typeless_typeful.yml

@@ -1,29 +0,0 @@
----
-"mtermvectors without types on an index that has types":
-
- - 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_offsets"
-
- - do:
-      index:
-          index:  index
-          id:     1
-          body:   { foo: bar }
-
- - do:
-      mtermvectors:
-          body:
-              docs:
-                  - _index: index
-                    _id: 1
-
- - match: {docs.0.term_vectors.foo.terms.bar.term_freq: 1}

+ 0 - 36
rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/11_basic_with_types.yml

@@ -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}

+ 0 - 42
rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/21_issue7121_with_types.yml

@@ -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

+ 0 - 40
rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/31_realtime_with_types.yml

@@ -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

+ 0 - 42
rest-api-spec/src/main/resources/rest-api-spec/test/termvectors/50_mix_typeless_typeful.yml

@@ -1,42 +0,0 @@
----
-"Term vectors with typeless API on an index that has types":
-
- - 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 

+ 2 - 16
server/src/main/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsAction.java

@@ -19,12 +19,10 @@
 
 package org.elasticsearch.rest.action.document;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.action.termvectors.MultiTermVectorsRequest;
 import org.elasticsearch.action.termvectors.TermVectorsRequest;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.index.mapper.MapperService;
 import org.elasticsearch.rest.BaseRestHandler;
@@ -38,10 +36,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
 import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestMultiTermVectorsAction extends BaseRestHandler {
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
-        LogManager.getLogger(RestTermVectorsAction.class));
-    static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " +
-        "Specifying types in multi term vector requests is deprecated.";
 
     public RestMultiTermVectorsAction(Settings settings, RestController controller) {
         super(settings);
@@ -49,10 +43,6 @@ public class RestMultiTermVectorsAction extends BaseRestHandler {
         controller.registerHandler(POST, "/_mtermvectors", this);
         controller.registerHandler(GET, "/{index}/_mtermvectors", this);
         controller.registerHandler(POST, "/{index}/_mtermvectors", this);
-
-        // Deprecated typed endpoints.
-        controller.registerHandler(GET, "/{index}/{type}/_mtermvectors", this);
-        controller.registerHandler(POST, "/{index}/{type}/_mtermvectors", this);
     }
 
     @Override
@@ -66,12 +56,8 @@ public class RestMultiTermVectorsAction extends BaseRestHandler {
         TermVectorsRequest template = new TermVectorsRequest()
             .index(request.param("index"));
 
-        if (request.hasParam("type")) {
-            deprecationLogger.deprecatedAndMaybeLog("mtermvectors_with_types", TYPES_DEPRECATION_MESSAGE);
-            template.type(request.param("type"));
-        } else {
-            template.type(MapperService.SINGLE_MAPPING_NAME);
-        }
+
+        template.type(MapperService.SINGLE_MAPPING_NAME);
 
         RestTermVectorsAction.readURIParameters(template, request);
         multiTermVectorsRequest.ids(Strings.commaDelimitedListToStringArray(request.param("ids")));

+ 2 - 21
server/src/main/java/org/elasticsearch/rest/action/document/RestTermVectorsAction.java

@@ -19,11 +19,9 @@
 
 package org.elasticsearch.rest.action.document;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.action.termvectors.TermVectorsRequest;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.XContentParser;
 import org.elasticsearch.index.VersionType;
@@ -46,10 +44,8 @@ import static org.elasticsearch.rest.RestRequest.Method.POST;
  * TermVectorsRequest.
  */
 public class RestTermVectorsAction extends BaseRestHandler {
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
-        LogManager.getLogger(RestTermVectorsAction.class));
     public static final String TYPES_DEPRECATION_MESSAGE = "[types removal] " +
-        "Specifying types in term vector requests is deprecated.";
+            "Specifying types in term vector requests is deprecated.";
 
     public RestTermVectorsAction(Settings settings, RestController controller) {
         super(settings);
@@ -57,12 +53,6 @@ public class RestTermVectorsAction extends BaseRestHandler {
         controller.registerHandler(POST, "/{index}/_termvectors", this);
         controller.registerHandler(GET, "/{index}/_termvectors/{id}", this);
         controller.registerHandler(POST, "/{index}/_termvectors/{id}", this);
-
-        // Deprecated typed endpoints.
-        controller.registerHandler(GET, "/{index}/{type}/_termvectors", this);
-        controller.registerHandler(POST, "/{index}/{type}/_termvectors", this);
-        controller.registerHandler(GET, "/{index}/{type}/{id}/_termvectors", this);
-        controller.registerHandler(POST, "/{index}/{type}/{id}/_termvectors", this);
     }
 
     @Override
@@ -73,16 +63,7 @@ public class RestTermVectorsAction extends BaseRestHandler {
     @Override
     public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
         TermVectorsRequest termVectorsRequest;
-        if (request.hasParam("type")) {
-            deprecationLogger.deprecatedAndMaybeLog("termvectors_with_types", TYPES_DEPRECATION_MESSAGE);
-            termVectorsRequest = new TermVectorsRequest(request.param("index"),
-                request.param("type"),
-                request.param("id"));
-        } else {
-            termVectorsRequest = new TermVectorsRequest(request.param("index"),
-                MapperService.SINGLE_MAPPING_NAME,
-                request.param("id"));
-        }
+        termVectorsRequest = new TermVectorsRequest(request.param("index"), MapperService.SINGLE_MAPPING_NAME, request.param("id"));
 
         if (request.hasContentOrSourceParam()) {
             try (XContentParser parser = request.contentOrSourceParamParser()) {

+ 1 - 20
server/src/main/java/org/elasticsearch/rest/action/search/RestMultiSearchAction.java

@@ -19,7 +19,6 @@
 
 package org.elasticsearch.rest.action.search;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.action.search.MultiSearchRequest;
 import org.elasticsearch.action.search.SearchRequest;
 import org.elasticsearch.action.support.IndicesOptions;
@@ -28,7 +27,6 @@ import org.elasticsearch.common.CheckedBiConsumer;
 import org.elasticsearch.common.Strings;
 import org.elasticsearch.common.bytes.BytesReference;
 import org.elasticsearch.common.collect.Tuple;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.XContent;
 import org.elasticsearch.common.xcontent.XContentParser;
@@ -50,10 +48,6 @@ import static org.elasticsearch.rest.RestRequest.Method.GET;
 import static org.elasticsearch.rest.RestRequest.Method.POST;
 
 public class RestMultiSearchAction extends BaseRestHandler {
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
-        LogManager.getLogger(RestMultiSearchAction.class));
-    static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" +
-        " Specifying types in multi search requests is deprecated.";
 
     private static final Set<String> RESPONSE_PARAMS;
 
@@ -73,10 +67,6 @@ public class RestMultiSearchAction extends BaseRestHandler {
         controller.registerHandler(GET, "/{index}/_msearch", this);
         controller.registerHandler(POST, "/{index}/_msearch", this);
 
-        // Deprecated typed endpoints.
-        controller.registerHandler(GET, "/{index}/{type}/_msearch", this);
-        controller.registerHandler(POST, "/{index}/{type}/_msearch", this);
-
         this.allowExplicitIndex = MULTI_ALLOW_EXPLICIT_INDEX.get(settings);
     }
 
@@ -88,14 +78,6 @@ public class RestMultiSearchAction extends BaseRestHandler {
     @Override
     public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
         MultiSearchRequest multiSearchRequest = parseRequest(request, allowExplicitIndex);
-
-        // Emit a single deprecation message if any search request contains types.
-        for (SearchRequest searchRequest : multiSearchRequest.requests()) {
-            if (searchRequest.types().length > 0) {
-                deprecationLogger.deprecatedAndMaybeLog("msearch_with_types", TYPES_DEPRECATION_MESSAGE);
-                break;
-            }
-        }
         return channel -> client.multiSearch(multiSearchRequest, new RestToXContentListener<>(channel));
     }
 
@@ -145,7 +127,6 @@ public class RestMultiSearchAction extends BaseRestHandler {
             CheckedBiConsumer<SearchRequest, XContentParser, IOException> consumer) throws IOException {
 
         String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
-        String[] types = Strings.splitStringByCommaToArray(request.param("type"));
         String searchType = request.param("search_type");
         boolean ccsMinimizeRoundtrips = request.paramAsBoolean("ccs_minimize_roundtrips", true);
         String routing = request.param("routing");
@@ -153,7 +134,7 @@ public class RestMultiSearchAction extends BaseRestHandler {
         final Tuple<XContentType, BytesReference> sourceTuple = request.contentOrSourceParam();
         final XContent xContent = sourceTuple.v1().xContent();
         final BytesReference data = sourceTuple.v2();
-        MultiSearchRequest.readMultiLineFormat(data, xContent, consumer, indices, indicesOptions, types, routing,
+        MultiSearchRequest.readMultiLineFormat(data, xContent, consumer, indices, indicesOptions, Strings.EMPTY_ARRAY, routing,
                 searchType, ccsMinimizeRoundtrips, request.getXContentRegistry(), allowExplicitIndex);
     }
 

+ 0 - 14
server/src/main/java/org/elasticsearch/rest/action/search/RestSearchAction.java

@@ -19,13 +19,11 @@
 
 package org.elasticsearch.rest.action.search;
 
-import org.apache.logging.log4j.LogManager;
 import org.elasticsearch.action.search.SearchRequest;
 import org.elasticsearch.action.support.IndicesOptions;
 import org.elasticsearch.client.node.NodeClient;
 import org.elasticsearch.common.Booleans;
 import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.logging.DeprecationLogger;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.XContentParser;
 import org.elasticsearch.index.query.QueryBuilder;
@@ -69,20 +67,12 @@ public class RestSearchAction extends BaseRestHandler {
         RESPONSE_PARAMS = Collections.unmodifiableSet(responseParams);
     }
 
-    private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSearchAction.class));
-    public static final String TYPES_DEPRECATION_MESSAGE = "[types removal]" +
-        " Specifying types in search requests is deprecated.";
-
     public RestSearchAction(Settings settings, RestController controller) {
         super(settings);
         controller.registerHandler(GET, "/_search", this);
         controller.registerHandler(POST, "/_search", this);
         controller.registerHandler(GET, "/{index}/_search", this);
         controller.registerHandler(POST, "/{index}/_search", this);
-
-        // Deprecated typed endpoints.
-        controller.registerHandler(GET, "/{index}/{type}/_search", this);
-        controller.registerHandler(POST, "/{index}/{type}/_search", this);
     }
 
     @Override
@@ -166,10 +156,6 @@ public class RestSearchAction extends BaseRestHandler {
             searchRequest.scroll(new Scroll(parseTimeValue(scroll, null, "scroll")));
         }
 
-        if (request.hasParam("type")) {
-            deprecationLogger.deprecatedAndMaybeLog("search_with_types", TYPES_DEPRECATION_MESSAGE);
-            searchRequest.types(Strings.splitStringByCommaToArray(request.param("type")));
-        }
         searchRequest.routing(request.param("routing"));
         searchRequest.preference(request.param("preference"));
         searchRequest.indicesOptions(IndicesOptions.fromRequest(request, searchRequest.indicesOptions()));

+ 0 - 87
server/src/test/java/org/elasticsearch/rest/action/document/RestMultiTermVectorsActionTests.java

@@ -1,87 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.elasticsearch.rest.action.document;
-
-import org.elasticsearch.common.bytes.BytesReference;
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.common.xcontent.XContentBuilder;
-import org.elasticsearch.common.xcontent.XContentFactory;
-import org.elasticsearch.common.xcontent.XContentType;
-import org.elasticsearch.rest.RestRequest;
-import org.elasticsearch.rest.RestRequest.Method;
-import org.elasticsearch.test.rest.RestActionTestCase;
-import org.elasticsearch.test.rest.FakeRestRequest;
-import org.junit.Before;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-public class RestMultiTermVectorsActionTests extends RestActionTestCase {
-
-    @Before
-    public void setUpAction() {
-        new RestMultiTermVectorsAction(Settings.EMPTY, controller());
-    }
-
-    public void testTypeInPath() {
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(Method.POST)
-            .withPath("/some_index/some_type/_mtermvectors")
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestMultiTermVectorsAction.TYPES_DEPRECATION_MESSAGE);
-    }
-
-    public void testTypeParameter() {
-        Map<String, String> params = new HashMap<>();
-        params.put("type", "some_type");
-
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(Method.GET)
-            .withPath("/some_index/_mtermvectors")
-            .withParams(params)
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestMultiTermVectorsAction.TYPES_DEPRECATION_MESSAGE);
-    }
-
-    public void testTypeInBody() throws IOException {
-        XContentBuilder content = XContentFactory.jsonBuilder().startObject()
-            .startArray("docs")
-                .startObject()
-                    .field("_type", "some_type")
-                    .field("_id", 1)
-                .endObject()
-            .endArray()
-        .endObject();
-
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(Method.GET)
-            .withPath("/some_index/_mtermvectors")
-            .withContent(BytesReference.bytes(content), XContentType.JSON)
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestTermVectorsAction.TYPES_DEPRECATION_MESSAGE);
-    }
-}

+ 0 - 67
server/src/test/java/org/elasticsearch/rest/action/document/RestTermVectorsActionTests.java

@@ -1,67 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.elasticsearch.rest.action.document;
-
-import org.elasticsearch.common.bytes.BytesReference;
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.common.xcontent.XContentBuilder;
-import org.elasticsearch.common.xcontent.XContentFactory;
-import org.elasticsearch.common.xcontent.XContentType;
-import org.elasticsearch.rest.RestRequest;
-import org.elasticsearch.rest.RestRequest.Method;
-import org.elasticsearch.test.rest.RestActionTestCase;
-import org.elasticsearch.test.rest.FakeRestRequest;
-import org.junit.Before;
-
-import java.io.IOException;
-
-public class RestTermVectorsActionTests extends RestActionTestCase {
-
-    @Before
-    public void setUpAction() {
-        new RestTermVectorsAction(Settings.EMPTY, controller());
-    }
-
-    public void testTypeInPath() {
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(Method.POST)
-            .withPath("/some_index/some_type/some_id/_termvectors")
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestTermVectorsAction.TYPES_DEPRECATION_MESSAGE);
-    }
-
-     public void testTypeInBody() throws IOException {
-        XContentBuilder content = XContentFactory.jsonBuilder().startObject()
-            .field("_type", "some_type")
-            .field("_id", 1)
-        .endObject();
-
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(Method.GET)
-            .withPath("/some_index/_termvectors/some_id")
-            .withContent(BytesReference.bytes(content), XContentType.JSON)
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestTermVectorsAction.TYPES_DEPRECATION_MESSAGE);
-    }
-}

+ 0 - 66
server/src/test/java/org/elasticsearch/rest/action/search/RestMultiSearchActionTests.java

@@ -1,66 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.elasticsearch.rest.action.search;
-
-import org.elasticsearch.common.bytes.BytesArray;
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.common.xcontent.XContentType;
-import org.elasticsearch.rest.RestRequest;
-import org.elasticsearch.test.rest.RestActionTestCase;
-import org.elasticsearch.test.rest.FakeRestRequest;
-import org.junit.Before;
-
-import java.nio.charset.StandardCharsets;
-
-public class RestMultiSearchActionTests extends RestActionTestCase {
-
-    @Before
-    public void setUpAction() {
-        new RestMultiSearchAction(Settings.EMPTY, controller());
-    }
-
-    public void testTypeInPath() {
-        String content = "{ \"index\": \"some_index\" } \n {} \n";
-        BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8));
-
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(RestRequest.Method.GET)
-            .withPath("/some_index/some_type/_msearch")
-            .withContent(bytesContent, XContentType.JSON)
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestMultiSearchAction.TYPES_DEPRECATION_MESSAGE);
-    }
-
-    public void testTypeInBody() {
-        String content = "{ \"index\": \"some_index\", \"type\": \"some_type\" } \n {} \n";
-        BytesArray bytesContent = new BytesArray(content.getBytes(StandardCharsets.UTF_8));
-
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(RestRequest.Method.POST)
-            .withPath("/some_index/_msearch")
-            .withContent(bytesContent, XContentType.JSON)
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestMultiSearchAction.TYPES_DEPRECATION_MESSAGE);
-    }
-}

+ 0 - 61
server/src/test/java/org/elasticsearch/rest/action/search/RestSearchActionTests.java

@@ -1,61 +0,0 @@
-/*
- * Licensed to Elasticsearch under one or more contributor
- * license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright
- * ownership. Elasticsearch licenses this file to you under
- * the Apache License, Version 2.0 (the "License"); you may
- * not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *    http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.elasticsearch.rest.action.search;
-
-import org.elasticsearch.common.settings.Settings;
-import org.elasticsearch.rest.RestRequest;
-import org.elasticsearch.test.rest.RestActionTestCase;
-import org.elasticsearch.test.rest.FakeRestRequest;
-import org.junit.Before;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class RestSearchActionTests extends RestActionTestCase {
-
-    @Before
-    public void setUpAction() {
-        new RestSearchAction(Settings.EMPTY, controller());
-    }
-
-    public void testTypeInPath() {
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(RestRequest.Method.GET)
-            .withPath("/some_index/some_type/_search")
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestSearchAction.TYPES_DEPRECATION_MESSAGE);
-    }
-
-    public void testTypeParameter() {
-        Map<String, String> params = new HashMap<>();
-        params.put("type", "some_type");
-
-        RestRequest request = new FakeRestRequest.Builder(xContentRegistry())
-            .withMethod(RestRequest.Method.GET)
-            .withPath("/some_index/_search")
-            .withParams(params)
-            .build();
-
-        dispatchRequest(request);
-        assertWarnings(RestSearchAction.TYPES_DEPRECATION_MESSAGE);
-    }
-}

+ 51 - 51
x-pack/plugin/security/src/test/java/org/elasticsearch/integration/IndexPrivilegeTests.java

@@ -158,10 +158,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u1", "all", "b");
         assertUserIsDenied("u1", "all", "c");
         assertAccessIsAllowed("u1",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u1", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u1", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsAllowed("u1", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u1",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -175,10 +175,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u2", "create_index", "b");
         assertUserIsDenied("u2", "all", "c");
         assertAccessIsAllowed("u2",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u2", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u2", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsAllowed("u2", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u2",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -189,10 +189,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsAllowed("u3", "all", "b");
         assertUserIsDenied("u3", "all", "c");
         assertAccessIsAllowed("u3",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u3", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u3", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsAllowed("u3", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u3",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -213,10 +213,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsAllowed("u4", "manage", "an_index");
 
         assertAccessIsAllowed("u4",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u4", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u4", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsDenied("u4", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u4",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -232,10 +232,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u5", "write", "b");
 
         assertAccessIsAllowed("u5",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u5", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u5", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsDenied("u5", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u5",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -248,10 +248,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u6", "write", "b");
         assertUserIsDenied("u6", "all", "c");
         assertAccessIsAllowed("u6",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u6", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u6", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsAllowed("u6", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u6",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -262,10 +262,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u7", "all", "b");
         assertUserIsDenied("u7", "all", "c");
         assertAccessIsDenied("u7",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsDenied("u7", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsDenied("u7", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsDenied("u7", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsDenied("u7",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -276,10 +276,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsAllowed("u8", "all", "b");
         assertUserIsAllowed("u8", "all", "c");
         assertAccessIsAllowed("u8",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u8", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u8", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsAllowed("u8", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u8",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -293,10 +293,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u9", "write", "b");
         assertUserIsDenied("u9", "all", "c");
         assertAccessIsAllowed("u9",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u9", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u9", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsAllowed("u9", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u9",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -316,10 +316,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u11", "monitor", "c");
 
         assertAccessIsDenied("u11",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsDenied("u11", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsDenied("u11", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertBodyHasAccessIsDenied("u11", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsDenied("u11",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -333,10 +333,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u12", "manage", "c");
         assertUserIsAllowed("u12", "data_access", "c");
         assertAccessIsAllowed("u12",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u12", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u12", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsAllowed("u12", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u12",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -355,10 +355,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u13", "all", "c");
 
         assertAccessIsAllowed("u13",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
         assertAccessIsAllowed("u13", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
-        assertAccessIsAllowed("u13", "PUT", "/a/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
-        assertBodyHasAccessIsDenied("u13", "PUT", "/b/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+        assertAccessIsAllowed("u13", "PUT", "/a/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+        assertBodyHasAccessIsDenied("u13", "PUT", "/b/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u13",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -377,10 +377,10 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
         assertUserIsDenied("u14", "all", "c");
 
         assertAccessIsAllowed("u14",
-                "GET", "/" + randomIndex() + "/foo/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
-        assertAccessIsAllowed("u14", "POST", "/" + randomIndex() + "/foo/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
+                "GET", "/" + randomIndex() + "/_msearch", "{}\n{ \"query\" : { \"match_all\" : {} } }\n");
+        assertAccessIsAllowed("u14", "POST", "/" + randomIndex() + "/_mget", "{ \"ids\" : [ \"1\", \"2\" ] } ");
         assertAccessIsDenied("u14", "PUT",
-                "/" + randomIndex() + "/foo/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
+                "/" + randomIndex() + "/_bulk", "{ \"index\" : { \"_id\" : \"123\" } }\n{ \"foo\" : \"bar\" }\n");
         assertAccessIsAllowed("u14",
                 "GET", "/" + randomIndex() + "/_mtermvectors", "{ \"docs\" : [ { \"_id\": \"1\" }, { \"_id\": \"2\" } ] }");
     }
@@ -434,7 +434,7 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
                     assertAccessIsAllowed(user, "POST", "/" + index + "/_open");
                     assertAccessIsAllowed(user, "POST", "/" + index + "/_cache/clear");
                     // indexing a document to have the mapping available, and wait for green state to make sure index is created
-                    assertAccessIsAllowed("admin", "PUT", "/" + index + "/foo/1", jsonDoc);
+                assertAccessIsAllowed("admin", "PUT", "/" + index + "/_doc/1", jsonDoc);
                     assertNoTimeout(client().admin().cluster().prepareHealth(index).setWaitForGreenStatus().get());
                     assertAccessIsAllowed(user, "GET", "/" + index + "/_mapping/field/name");
                     assertAccessIsAllowed(user, "GET", "/" + index + "/_settings");
@@ -490,7 +490,7 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
                     assertAccessIsAllowed("admin", "GET", "/" + index + "/_refresh");
                     assertAccessIsAllowed(user, "GET", "/" + index + "/_count");
                     assertAccessIsAllowed("admin", "GET", "/" + index + "/_search");
-                    assertAccessIsAllowed("admin", "GET", "/" + index + "/foo/1");
+                assertAccessIsAllowed("admin", "GET", "/" + index + "/_doc/1");
                     assertAccessIsAllowed(user, "GET", "/" + index + "/_explain/1", "{ \"query\" : { \"match_all\" : {} } }");
                     assertAccessIsAllowed(user, "GET", "/" + index + "/_termvectors/1");
                     assertUserIsAllowed(user, "search", index);
@@ -513,30 +513,30 @@ public class IndexPrivilegeTests extends AbstractPrivilegeTestCase {
 
             case "get" :
                 if (userIsAllowed) {
-                    assertAccessIsAllowed(user, "GET", "/" + index + "/foo/1");
+                assertAccessIsAllowed(user, "GET", "/" + index + "/_doc/1");
                 } else {
-                    assertAccessIsDenied(user, "GET", "/" + index + "/foo/1");
+                assertAccessIsDenied(user, "GET", "/" + index + "/_doc/1");
                 }
                 break;
 
             case "index" :
                 if (userIsAllowed) {
-                    assertAccessIsAllowed(user, "PUT", "/" + index + "/foo/321", "{ \"foo\" : \"bar\" }");
-                    assertAccessIsAllowed(user, "POST", "/" + index + "/foo/321/_update", "{ \"doc\" : { \"foo\" : \"baz\" } }");
+                assertAccessIsAllowed(user, "PUT", "/" + index + "/_doc/321", "{ \"foo\" : \"bar\" }");
+                assertAccessIsAllowed(user, "POST", "/" + index + "/_doc/321/_update", "{ \"doc\" : { \"foo\" : \"baz\" } }");
                 } else {
-                    assertAccessIsDenied(user, "PUT", "/" + index + "/foo/321", "{ \"foo\" : \"bar\" }");
-                    assertAccessIsDenied(user, "POST", "/" + index + "/foo/321/_update", "{ \"doc\" : { \"foo\" : \"baz\" } }");
+                assertAccessIsDenied(user, "PUT", "/" + index + "/_doc/321", "{ \"foo\" : \"bar\" }");
+                assertAccessIsDenied(user, "POST", "/" + index + "/_doc/321/_update", "{ \"doc\" : { \"foo\" : \"baz\" } }");
                 }
                 break;
 
             case "delete" :
                 String jsonDoc = "{ \"name\" : \"docToDelete\"}";
-                assertAccessIsAllowed("admin", "PUT", "/" + index + "/foo/docToDelete", jsonDoc);
-                assertAccessIsAllowed("admin", "PUT", "/" + index + "/foo/docToDelete2", jsonDoc);
+            assertAccessIsAllowed("admin", "PUT", "/" + index + "/_doc/docToDelete", jsonDoc);
+            assertAccessIsAllowed("admin", "PUT", "/" + index + "/_doc/docToDelete2", jsonDoc);
                 if (userIsAllowed) {
-                    assertAccessIsAllowed(user, "DELETE", "/" + index + "/foo/docToDelete");
+                assertAccessIsAllowed(user, "DELETE", "/" + index + "/_doc/docToDelete");
                 } else {
-                    assertAccessIsDenied(user, "DELETE", "/" + index + "/foo/docToDelete");
+                assertAccessIsDenied(user, "DELETE", "/" + index + "/_doc/docToDelete");
                 }
                 break;