Module org.elasticsearch.server
Class QueryPhaseRankShardContext
java.lang.Object
org.elasticsearch.search.rank.context.QueryPhaseRankShardContext
- Direct Known Subclasses:
RerankingQueryPhaseRankShardContext
QueryPhaseRankShardContext is used to generate the top rank_window_size
results on each shard. It specifies the queries to run during QueryPhase and is responsible for combining all query scores and
order all results through the combineQueryPhaseResults(java.util.List<org.apache.lucene.search.TopDocs>) method.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<org.apache.lucene.search.Query> protected final int -
Constructor Summary
ConstructorsConstructorDescriptionQueryPhaseRankShardContext(List<org.apache.lucene.search.Query> queries, int rankWindowSize) -
Method Summary
Modifier and TypeMethodDescriptionabstract RankShardResultcombineQueryPhaseResults(List<org.apache.lucene.search.TopDocs> rankResults) This is used to reduce the number of required results that are serialized to the coordinating node.List<org.apache.lucene.search.Query> queries()int
-
Field Details
-
queries
-
rankWindowSize
protected final int rankWindowSize
-
-
Constructor Details
-
QueryPhaseRankShardContext
-
-
Method Details
-
queries
-
rankWindowSize
public int rankWindowSize() -
combineQueryPhaseResults
public abstract RankShardResult combineQueryPhaseResults(List<org.apache.lucene.search.TopDocs> rankResults) This is used to reduce the number of required results that are serialized to the coordinating node. Normally we would have to serializequeries * rank_window_sizeresults, but we can infer that there will likely be overlap of document results. Given that we know any searches that match the same document must be on the same shard, we can sort on the shard instead for a top rank_window_size set of results and reduce the amount of data we serialize.
-