From 567c65b0d57e92cd530dafa7f55de7ba681af13e Mon Sep 17 00:00:00 2001 From: Nik Everett Date: Wed, 21 Dec 2016 09:05:14 -0500 Subject: Replace IndicesQueriesRegistry (#22289) * Switch query parsing to namedObject * Remove IndicesQueriesRegistry --- .../elasticsearch/rest/action/document/RestCountAction.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'core/src/main/java/org/elasticsearch/rest/action/document') diff --git a/core/src/main/java/org/elasticsearch/rest/action/document/RestCountAction.java b/core/src/main/java/org/elasticsearch/rest/action/document/RestCountAction.java index 2983879961..86acb1fb1b 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/document/RestCountAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/document/RestCountAction.java @@ -19,7 +19,6 @@ package org.elasticsearch.rest.action.document; -import org.apache.lucene.util.IOUtils; import org.elasticsearch.action.search.SearchRequest; import org.elasticsearch.action.search.SearchResponse; import org.elasticsearch.action.support.IndicesOptions; @@ -28,9 +27,7 @@ import org.elasticsearch.common.Strings; import org.elasticsearch.common.inject.Inject; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.index.query.QueryBuilder; -import org.elasticsearch.indices.query.IndicesQueriesRegistry; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.BytesRestResponse; import org.elasticsearch.rest.RestController; @@ -48,11 +45,8 @@ import static org.elasticsearch.rest.action.RestActions.buildBroadcastShardsHead import static org.elasticsearch.search.internal.SearchContext.DEFAULT_TERMINATE_AFTER; public class RestCountAction extends BaseRestHandler { - - private final IndicesQueriesRegistry indicesQueriesRegistry; - @Inject - public RestCountAction(Settings settings, RestController controller, IndicesQueriesRegistry indicesQueriesRegistry) { + public RestCountAction(Settings settings, RestController controller) { super(settings); controller.registerHandler(POST, "/_count", this); controller.registerHandler(GET, "/_count", this); @@ -60,7 +54,6 @@ public class RestCountAction extends BaseRestHandler { controller.registerHandler(GET, "/{index}/_count", this); controller.registerHandler(POST, "/{index}/{type}/_count", this); controller.registerHandler(GET, "/{index}/{type}/_count", this); - this.indicesQueriesRegistry = indicesQueriesRegistry; } @Override @@ -76,7 +69,7 @@ public class RestCountAction extends BaseRestHandler { searchSourceBuilder.query(queryBuilder); } } else { - searchSourceBuilder.query(RestActions.getQueryContent(parser, indicesQueriesRegistry, parseFieldMatcher)); + searchSourceBuilder.query(RestActions.getQueryContent(parser, parseFieldMatcher)); } }); countRequest.routing(request.param("routing")); -- cgit v1.2.3