Module org.elasticsearch.server
Class RerankingQueryPhaseRankShardContext
java.lang.Object
org.elasticsearch.search.rank.context.QueryPhaseRankShardContext
org.elasticsearch.search.rank.rerank.RerankingQueryPhaseRankShardContext
The
RerankingQueryPhaseRankShardContext is responsible for combining the different shard-level query results, and
then pack them to a RankFeatureShardResult to return to the coordinator. If a document is found in more than one queries, we
only keep the max score for that document. This is to be treated with care, as different queries might have different score ranges that
could affect the final ranking.-
Field Summary
Fields inherited from class org.elasticsearch.search.rank.context.QueryPhaseRankShardContext
queries, rankWindowSize -
Constructor Summary
ConstructorsConstructorDescriptionRerankingQueryPhaseRankShardContext(List<org.apache.lucene.search.Query> queries, int windowSize) -
Method Summary
Modifier and TypeMethodDescriptioncombineQueryPhaseResults(List<org.apache.lucene.search.TopDocs> rankResults) This is used to reduce the number of required results that are serialized to the coordinating node.Methods inherited from class org.elasticsearch.search.rank.context.QueryPhaseRankShardContext
queries, rankWindowSize
-
Constructor Details
-
RerankingQueryPhaseRankShardContext
public RerankingQueryPhaseRankShardContext(List<org.apache.lucene.search.Query> queries, int windowSize)
-
-
Method Details
-
combineQueryPhaseResults
Description copied from class:QueryPhaseRankShardContextThis 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.- Specified by:
combineQueryPhaseResultsin classQueryPhaseRankShardContext
-