Inline TransportSearchAction#doExecute

This commit is contained in:
Jason Tedor 2016-06-21 18:08:15 -04:00
parent 81ba43888f
commit abae58b5fb
1 changed files with 6 additions and 4 deletions

View File

@ -42,9 +42,6 @@ import java.util.Set;
import static org.elasticsearch.action.search.SearchType.QUERY_AND_FETCH;
import static org.elasticsearch.action.search.SearchType.QUERY_THEN_FETCH;
/**
*
*/
public class TransportSearchAction extends HandledTransportAction<SearchRequest, SearchResponse> {
/** The maximum number of shards for a single search request. */
@ -96,6 +93,10 @@ public class TransportSearchAction extends HandledTransportAction<SearchRequest,
logger.debug("failed to optimize search type, continue as normal", e);
}
searchAsyncAction(searchRequest, listener).start();
}
private AbstractSearchAsyncAction searchAsyncAction(SearchRequest searchRequest, ActionListener<SearchResponse> listener) {
AbstractSearchAsyncAction searchAsyncAction;
switch(searchRequest.searchType()) {
case DFS_QUERY_THEN_FETCH:
@ -117,6 +118,7 @@ public class TransportSearchAction extends HandledTransportAction<SearchRequest,
default:
throw new IllegalStateException("Unknown search type: [" + searchRequest.searchType() + "]");
}
searchAsyncAction.start();
return searchAsyncAction;
}
}