Class SearchProgressActionListener

java.lang.Object
org.elasticsearch.action.search.SearchProgressActionListener
All Implemented Interfaces:
ActionListener<SearchResponse>

public abstract class SearchProgressActionListener
extends java.lang.Object
implements ActionListener<SearchResponse>
An ActionListener for search requests that allows to track progress of the SearchAction. See SearchProgressListener.
  • Field Details

    • NOOP

      public static final org.elasticsearch.action.search.SearchProgressListener NOOP
  • Constructor Details

  • Method Details

    • onListShards

      protected void onListShards​(java.util.List<SearchShard> shards, java.util.List<SearchShard> skippedShards, SearchResponse.Clusters clusters, boolean fetchPhase)
      Executed when shards are ready to be queried.
      Parameters:
      shards - The list of shards to query.
      skippedShards - The list of skipped shards.
      clusters - The statistics for remote clusters included in the search.
      fetchPhase - true if the search needs a fetch phase, false otherwise.
    • onQueryResult

      protected void onQueryResult​(int shardIndex)
      Executed when a shard returns a query result.
      Parameters:
      shardIndex - The index of the shard in the list provided by SearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean) )}.
    • onQueryFailure

      protected void onQueryFailure​(int shardIndex, SearchShardTarget shardTarget, java.lang.Exception exc)
      Executed when a shard reports a query failure.
      Parameters:
      shardIndex - The index of the shard in the list provided by SearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean))}.
      shardTarget - The last shard target that thrown an exception.
      exc - The cause of the failure.
    • onPartialReduce

      protected void onPartialReduce​(java.util.List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, DelayableWriteable.Serialized<InternalAggregations> aggs, int reducePhase)
      Executed when a partial reduce is created. The number of partial reduce can be controlled via SearchRequest.setBatchedReduceSize(int).
      Parameters:
      shards - The list of shards that are part of this reduce.
      totalHits - The total number of hits in this reduce.
      aggs - The partial result for aggregations stored in serialized form.
      reducePhase - The version number for this reduce.
    • onFinalReduce

      protected void onFinalReduce​(java.util.List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase)
      Executed once when the final reduce is created.
      Parameters:
      shards - The list of shards that are part of this reduce.
      totalHits - The total number of hits in this reduce.
      aggs - The final result for aggregations.
      reducePhase - The version number for this reduce.
    • onFetchResult

      protected void onFetchResult​(int shardIndex)
      Executed when a shard returns a fetch result.
      Parameters:
      shardIndex - The index of the shard in the list provided by SearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean))}.
    • onFetchFailure

      protected void onFetchFailure​(int shardIndex, SearchShardTarget shardTarget, java.lang.Exception exc)
      Executed when a shard reports a fetch failure.
      Parameters:
      shardIndex - The index of the shard in the list provided by SearchProgressListener.onListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean))}.
      shardTarget - The last shard target that thrown an exception.
      exc - The cause of the failure.
    • notifyFinalReduce

      protected final void notifyFinalReduce​(java.util.List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase)