java.lang.Object
org.elasticsearch.action.search.SearchPhaseController
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordstatic final class -
Constructor Summary
ConstructorsConstructorDescriptionSearchPhaseController(BiFunction<Supplier<Boolean>, AggregatorFactories.Builder, AggregationReduceContext.Builder> requestToAggReduceContextBuilder) -
Method Summary
Modifier and TypeMethodDescriptionfillDocIdsToLoad(int numShards, org.apache.lucene.search.ScoreDoc[] shardDocs) Builds an array, with potential null elements, with docs to load.static org.apache.lucene.search.ScoreDoc[]getLastEmittedDocPerShard(SearchPhaseController.ReducedQueryPhase reducedQueryPhase, int numShards) static SearchResponseSectionsmerge(boolean ignoreFrom, SearchPhaseController.ReducedQueryPhase reducedQueryPhase, AtomicArray<? extends SearchPhaseResult> fetchResultsArray) Enriches search hits and completion suggestion hits fromsortedDocsusingfetchResultsArr, merges suggestions, aggregations and profile results Expects sortedDocs to have top search docs across all shards, optionally followed by top suggest docs for each named completion suggestion ordered by suggestion name
-
Constructor Details
-
SearchPhaseController
public SearchPhaseController(BiFunction<Supplier<Boolean>, AggregatorFactories.Builder, AggregationReduceContext.Builder> requestToAggReduceContextBuilder)
-
-
Method Details
-
getLastEmittedDocPerShard
public static org.apache.lucene.search.ScoreDoc[] getLastEmittedDocPerShard(SearchPhaseController.ReducedQueryPhase reducedQueryPhase, int numShards) -
fillDocIdsToLoad
public static List<Integer>[] fillDocIdsToLoad(int numShards, org.apache.lucene.search.ScoreDoc[] shardDocs) Builds an array, with potential null elements, with docs to load. -
merge
public static SearchResponseSections merge(boolean ignoreFrom, SearchPhaseController.ReducedQueryPhase reducedQueryPhase, AtomicArray<? extends SearchPhaseResult> fetchResultsArray) Enriches search hits and completion suggestion hits fromsortedDocsusingfetchResultsArr, merges suggestions, aggregations and profile results Expects sortedDocs to have top search docs across all shards, optionally followed by top suggest docs for each named completion suggestion ordered by suggestion name
-