@Override public CollapseContext collapse() { return in.collapse(); } }
private void cleanContext(SearchContext context) { try { context.clearReleasables(Lifetime.PHASE); context.setTask(null); } finally { context.decRef(); } }
@Override protected final void closeInternal() { try { clearReleasables(Lifetime.CONTEXT); } finally { doClose(); } }
@Override public ContextIndexSearcher searcher() { return in.searcher(); }
/** * Creates a new search response from the given merged hits. * @see #merge(boolean, ReducedQueryPhase, Collection, IntFunction) */ public InternalSearchResponse buildResponse(SearchHits hits) { return new InternalSearchResponse(hits, aggregations, suggest, shardResults, timedOut, terminatedEarly, numReducePhases); } }
public ShardSearchTransportRequest(OriginalIndices originalIndices, SearchRequest searchRequest, ShardId shardId, int numberOfShards, AliasFilter aliasFilter, float indexBoost, long nowInMillis, String clusterAlias, String[] indexRoutings) { this.shardSearchLocalRequest = new ShardSearchLocalRequest(searchRequest, shardId, numberOfShards, aliasFilter, indexBoost, nowInMillis, clusterAlias, indexRoutings); this.originalIndices = originalIndices; }
@Override public SearchContext aggregations(SearchContextAggregations aggregations) { return in.aggregations(aggregations); }
@Override public FetchSourceContext fetchSourceContext() { return in.fetchSourceContext(); }
@Override public Query aliasFilter() { return in.aliasFilter(); }
@Override public SearchContext docIdsToLoad(int[] docIdsToLoad, int docsIdsToLoadFrom, int docsIdsToLoadSize) { return in.docIdsToLoad(docIdsToLoad, docsIdsToLoadFrom, docsIdsToLoadSize); }
private boolean fetchPhaseShouldFreeContext(SearchContext context) { if (context.scrollContext() == null) { // simple search, no scroll return true; } else { // scroll request, but the scroll was not extended return context.scrollContext().scroll == null; } }
@Override public String getDescription() { // Shard id is enough here, the request itself can be found by looking at the parent task description return "shardId[" + shardSearchLocalRequest.shardId() + "]"; }
@Override public boolean hasFetchSourceContext() { return in.hasFetchSourceContext(); }
@Override public int terminateAfter() { return in.terminateAfter(); }
@Override public boolean explain() { return in.explain(); }
@Override public boolean version() { return in.version(); }
@Override public boolean hasStoredFieldsContext() { return in.hasStoredFieldsContext(); }
@Override public Rewriteable<Rewriteable> getRewriteable() { return shardSearchLocalRequest.getRewriteable(); } }
@Override public SearchContext scrollContext(ScrollContext scroll) { return in.scrollContext(scroll); }