From cd608848e7fb6645816df9044b0b6419f16dfe5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20B=C3=BCscher?= Date: Thu, 10 Jan 2019 12:50:07 +0100 Subject: [PATCH] Remove deprecated QUERY_AND_FETCH SearchType (#37257) This SearchType was deprecated since at least 6.0 and according to the documentation is only kept around for pre-5.3 requests. Removing and leaving a comment as placeholder so we don't reuse the byte value associated with it without further consideration. --- .../org/elasticsearch/action/search/SearchType.java | 11 +++-------- .../action/search/TransportSearchAction.java | 4 ++-- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/server/src/main/java/org/elasticsearch/action/search/SearchType.java b/server/src/main/java/org/elasticsearch/action/search/SearchType.java index 910bc3d676a..1a382fa9caf 100644 --- a/server/src/main/java/org/elasticsearch/action/search/SearchType.java +++ b/server/src/main/java/org/elasticsearch/action/search/SearchType.java @@ -36,14 +36,9 @@ public enum SearchType { * document content. The return number of hits is exactly as specified in size, since they are the only ones that * are fetched. This is very handy when the index has a lot of shards (not replicas, shard id groups). */ - QUERY_THEN_FETCH((byte) 1), + QUERY_THEN_FETCH((byte) 1); // 2 used to be DFS_QUERY_AND_FETCH - - /** - * Only used for pre 5.3 request where this type is still needed - */ - @Deprecated - QUERY_AND_FETCH((byte) 3); + // 3 used to be QUERY_AND_FETCH /** * The default search type ({@link #QUERY_THEN_FETCH}. @@ -99,5 +94,5 @@ public enum SearchType { throw new IllegalArgumentException("No search type for [" + searchType + "]"); } } - + } diff --git a/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java b/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java index 463d1487d03..88e2764982c 100644 --- a/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java +++ b/server/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java @@ -42,6 +42,7 @@ import org.elasticsearch.common.settings.Setting.Property; import org.elasticsearch.index.Index; import org.elasticsearch.index.query.Rewriteable; import org.elasticsearch.index.shard.ShardId; +import org.elasticsearch.search.SearchPhaseResult; import org.elasticsearch.search.SearchService; import org.elasticsearch.search.builder.SearchSourceBuilder; import org.elasticsearch.search.internal.AliasFilter; @@ -413,14 +414,13 @@ public class TransportSearchAction extends HandledTransportAction searchAsyncAction; switch (searchRequest.searchType()) { case DFS_QUERY_THEN_FETCH: searchAsyncAction = new SearchDfsQueryThenFetchAsyncAction(logger, searchTransportService, connectionLookup, aliasFilter, concreteIndexBoosts, indexRoutings, searchPhaseController, executor, searchRequest, listener, shardIterators, timeProvider, clusterStateVersion, task, clusters); break; - case QUERY_AND_FETCH: case QUERY_THEN_FETCH: searchAsyncAction = new SearchQueryThenFetchAsyncAction(logger, searchTransportService, connectionLookup, aliasFilter, concreteIndexBoosts, indexRoutings, searchPhaseController, executor, searchRequest, listener,