Browse Source

don't log index missing exception when trying to optimize single shard search request

kimchy 14 years ago
parent
commit
10ff150bb8

+ 4 - 0
modules/elasticsearch/src/main/java/org/elasticsearch/action/search/TransportSearchAction.java

@@ -31,6 +31,7 @@ import org.elasticsearch.cluster.ClusterState;
 import org.elasticsearch.cluster.routing.GroupShardsIterator;
 import org.elasticsearch.common.inject.Inject;
 import org.elasticsearch.common.settings.Settings;
+import org.elasticsearch.indices.IndexMissingException;
 import org.elasticsearch.transport.BaseTransportRequestHandler;
 import org.elasticsearch.transport.TransportChannel;
 import org.elasticsearch.transport.TransportService;
@@ -82,6 +83,9 @@ public class TransportSearchAction extends BaseAction<SearchRequest, SearchRespo
                     // if we only have one group, then we always want Q_A_F, no need for DFS, and no need to do THEN since we hit one shard
                     searchRequest.searchType(QUERY_AND_FETCH);
                 }
+            } catch (IndexMissingException e) {
+                // ignore this, we will notify the search response if its really the case
+                // from the actual action
             } catch (Exception e) {
                 logger.debug("failed to optimize search type, continue as normal", e);
             }