Module org.elasticsearch.server
Package org.elasticsearch.action.search
Class SearchProgressListener
java.lang.Object
org.elasticsearch.action.search.SearchProgressListener
- Direct Known Subclasses:
CCSSingleCoordinatorSearchProgressListener,SearchProgressActionListener
A listener that allows to track progress of the
TransportSearchAction.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidnotifyFinalReduce(List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase) protected voidonClusterResponseMinimizeRoundtrips(String clusterAlias, SearchResponse searchResponse) Indicates that a cluster has finished a search operation.protected voidonFetchFailure(int shardIndex, SearchShardTarget shardTarget, Exception exc) Executed when a shard reports a fetch failure.protected voidonFetchResult(int shardIndex) Executed when a shard returns a fetch result.protected voidonFinalReduce(List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase) Executed once when the final reduce is created.protected voidonListShards(List<SearchShard> shards, List<SearchShard> skippedShards, SearchResponse.Clusters clusters, boolean fetchPhase, TransportSearchAction.SearchTimeProvider timeProvider) Executed when shards are ready to be queried.protected voidonPartialReduce(List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase) Executed when a partial reduce is created.protected voidonQueryFailure(int shardIndex, SearchShardTarget shardTarget, Exception exc) Executed when a shard reports a query failure.protected voidonQueryResult(int shardIndex, QuerySearchResult queryResult) Executed when a shard returns a query result.protected voidonRankFeatureFailure(int shardIndex, SearchShardTarget shardTarget, Exception exc) Executed when a shard reports a rank feature failure.protected voidonRankFeatureResult(int shardIndex) Executed when a shard returns a rank feature result.
-
Field Details
-
NOOP
-
-
Constructor Details
-
SearchProgressListener
public SearchProgressListener()
-
-
Method Details
-
onListShards
protected void onListShards(List<SearchShard> shards, List<SearchShard> skippedShards, SearchResponse.Clusters clusters, boolean fetchPhase, TransportSearchAction.SearchTimeProvider timeProvider) 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-trueif the search needs a fetch phase,falseotherwise.timeProvider- absolute and relative time provider for this search
-
onQueryResult
Executed when a shard returns a query result.- Parameters:
shardIndex- The index of the shard in the list provided byonListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.queryResult-
-
onQueryFailure
Executed when a shard reports a query failure.- Parameters:
shardIndex- The index of the shard in the list provided byonListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.shardTarget- The last shard target that thrown an exception.exc- The cause of the failure.
-
onPartialReduce
protected void onPartialReduce(List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase) Executed when a partial reduce is created. The number of partial reduce can be controlled viaSearchRequest.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.reducePhase- The version number for this reduce.
-
onFinalReduce
protected void onFinalReduce(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.
-
onRankFeatureResult
protected void onRankFeatureResult(int shardIndex) Executed when a shard returns a rank feature result.- Parameters:
shardIndex- The index of the shard in the list provided byonListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.
-
onRankFeatureFailure
Executed when a shard reports a rank feature failure.- Parameters:
shardIndex- The index of the shard in the list provided byonListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.shardTarget- The last shard target that thrown an exception.exc- The cause of the failure.
-
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 byonListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.
-
onFetchFailure
Executed when a shard reports a fetch failure.- Parameters:
shardIndex- The index of the shard in the list provided byonListShards(java.util.List<org.elasticsearch.action.search.SearchShard>, java.util.List<org.elasticsearch.action.search.SearchShard>, org.elasticsearch.action.search.SearchResponse.Clusters, boolean, org.elasticsearch.action.search.TransportSearchAction.SearchTimeProvider))}.shardTarget- The last shard target that thrown an exception.exc- The cause of the failure.
-
onClusterResponseMinimizeRoundtrips
protected void onClusterResponseMinimizeRoundtrips(String clusterAlias, SearchResponse searchResponse) Indicates that a cluster has finished a search operation. Used for CCS minimize_roundtrips=true only.- Parameters:
clusterAlias- alias of cluster that has finished a search operation and returned a SearchResponse. The cluster alias for the local cluster is RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY.searchResponse- SearchResponse from cluster 'clusterAlias'
-
notifyFinalReduce
protected final void notifyFinalReduce(List<SearchShard> shards, org.apache.lucene.search.TotalHits totalHits, InternalAggregations aggs, int reducePhase)
-