Class RankFeaturePhaseRankShardContext

java.lang.Object
org.elasticsearch.search.rank.context.RankFeaturePhaseRankShardContext
Direct Known Subclasses:
RerankingRankFeaturePhaseRankShardContext

public abstract class RankFeaturePhaseRankShardContext extends Object
RankFeaturePhaseRankShardContext is a base class used to execute the RankFeature phase on each shard. In this class, we can fetch the feature data for a given set of documents and pass them back to the coordinator through the RankShardResult.
  • Field Details

    • field

      protected final String field
  • Constructor Details

    • RankFeaturePhaseRankShardContext

      public RankFeaturePhaseRankShardContext(String field)
  • Method Details

    • getField

      public String getField()
    • buildRankFeatureShardResult

      @Nullable public abstract RankShardResult buildRankFeatureShardResult(SearchHits hits, int shardId)
      This is used to fetch the feature data for a given set of documents, using the FetchPhase and the FetchFieldsPhase subphase. The feature data is then stored in a RankFeatureDoc and passed back to the coordinator.
    • prepareForFetch

      public void prepareForFetch(SearchContext context)
      Prepares a SearchContext with any additional information needed before executing commands on shards.
      Parameters:
      context - SearchContext