From 681239b41324cafc8eb211f781cacea74386f672 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Wed, 13 Feb 2013 17:51:18 +0100 Subject: [PATCH] Warmers do not load field data cache for sorting on new segments fixes #2649 --- src/main/java/org/elasticsearch/search/SearchService.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/search/SearchService.java b/src/main/java/org/elasticsearch/search/SearchService.java index 2f25d39fdef..a406d3c42fc 100644 --- a/src/main/java/org/elasticsearch/search/SearchService.java +++ b/src/main/java/org/elasticsearch/search/SearchService.java @@ -639,7 +639,8 @@ public class SearchService extends AbstractLifecycleComponent { SearchContext context = null; try { long now = System.nanoTime(); - ShardSearchRequest request = new ShardSearchRequest(indexShard.shardId().index().name(), indexShard.shardId().id(), indexMetaData.numberOfShards(), SearchType.COUNT) + ShardSearchRequest request = new ShardSearchRequest(indexShard.shardId().index().name(), indexShard.shardId().id(), indexMetaData.numberOfShards(), + SearchType.QUERY_THEN_FETCH /* we don't use COUNT so sorting will also kick in whatever warming logic*/) .source(entry.source()) .types(entry.types()); context = createContext(request, warmerContext.newSearcher());