@Override public SearchShardTarget shardTarget() { return in.shardTarget(); }
public SearchContextException(SearchContext context, String msg, Throwable t) { super(context.shardTarget(), msg, t); }
public SearchContextException(SearchContext context, String msg) { super(context.shardTarget(), msg); }
@Override public String toString() { StringBuilder result = new StringBuilder().append(shardTarget()); if (searchType() != SearchType.DEFAULT) { result.append("searchType=[").append(searchType()).append("]"); } if (scrollContext() != null) { if (scrollContext().scroll != null) { result.append("scroll=[").append(scrollContext().scroll.keepAlive()).append("]"); } else { result.append("scroll=[null]"); } } result.append(" query=[").append(query()).append("]"); return result.toString(); } }
@Override public SearchShardTarget shardTarget() { return in.shardTarget(); }
@Override public SearchShardTarget shardTarget() { return in.shardTarget(); }
@Override public SearchShardTarget shardTarget() { return in.shardTarget(); }
@Override public SearchShardTarget shardTarget() { return in.shardTarget(); }
public SearchContextException(SearchContext context, String msg) { super(context.shardTarget(), msg); }
public SearchContextException(SearchContext context, String msg, Throwable t) { super(context.shardTarget(), msg, t); }
public SearchContextException(SearchContext context, String msg, Throwable t) { super(context.shardTarget(), msg, t); }
public SearchContextException(SearchContext context, String msg) { super(context.shardTarget(), msg); }
public SearchContextException(SearchContext context, String msg) { super(context.shardTarget(), msg); }
public SearchContextException(SearchContext context, String msg, Throwable t) { super(context.shardTarget(), msg, t); }
public SearchContextException(SearchContext context, String msg) { super(context.shardTarget(), msg); }
public SearchContextException(SearchContext context, String msg, Throwable t) { super(context.shardTarget(), msg, t); }
public void executeQueryPhase(InternalScrollSearchRequest request, SearchTask task, ActionListener<ScrollQuerySearchResult> listener) { runAsync(request.id(), () -> { final SearchContext context = findContext(request.id(), request); SearchOperationListener operationListener = context.indexShard().getSearchOperationListener(); context.incRef(); try { context.setTask(task); operationListener.onPreQueryPhase(context); long time = System.nanoTime(); contextProcessing(context); processScroll(request, context); queryPhase.execute(context); contextProcessedSuccessfully(context); operationListener.onQueryPhase(context, System.nanoTime() - time); return new ScrollQuerySearchResult(context.queryResult(), context.shardTarget()); } catch (Exception e) { operationListener.onFailedQueryPhase(context); logger.trace("Query phase failed", e); processFailure(context, e); throw ExceptionsHelper.convertToRuntime(e); } finally { cleanContext(context); } }, listener); }
operationListener.onQueryPhase(context, afterQueryTime - time); QueryFetchSearchResult fetchSearchResult = executeFetchPhase(context, operationListener, afterQueryTime); return new ScrollQueryFetchSearchResult(fetchSearchResult, context.shardTarget()); } catch (Exception e) { logger.trace("Fetch phase failed", e);
StreamInput in = new NamedWriteableAwareStreamInput(bytesReference.streamInput(), namedWriteableRegistry); result.readFromWithId(context.id(), in); result.setSearchShardTarget(context.shardTarget()); } else if (context.queryResult().searchTimedOut()) {
@Override public void parse(XContentParser parser, SearchContext context) throws Exception { SuggestionSearchContext suggestionSearchContext = parseInternal(parser, context.mapperService(), context.queryParserService(), context.shardTarget().index(), context.shardTarget().shardId(), context); context.suggest(suggestionSearchContext); }