Class SearchResponse.Cluster

java.lang.Object
org.elasticsearch.action.search.SearchResponse.Cluster
All Implemented Interfaces:
Writeable, ToXContent, ToXContentFragment
Enclosing class:
SearchResponse

public static class SearchResponse.Cluster extends Object implements ToXContentFragment, Writeable
Represents the search metadata about a particular cluster involved in a cross-cluster search. The Cluster object can represent either the local cluster or a remote cluster. For the local cluster, clusterAlias should be specified as RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY. Its XContent is put into the "details" section the "_clusters" entry in the SearchResponse. This is an immutable class, so updates made during the search progress (especially important for async CCS searches) must be done by replacing the Cluster object with a new one. See the Clusters clusterInfo Map for details.
  • Field Details

    • SEARCH_RESPONSE_ORIGIN_CLUSTER_LABEL_TV

      public static final TransportVersion SEARCH_RESPONSE_ORIGIN_CLUSTER_LABEL_TV
    • INDICES_FIELD

      public static final ParseField INDICES_FIELD
    • STATUS_FIELD

      public static final ParseField STATUS_FIELD
    • SKIP_UNAVAILABLE_DEFAULT

      public static final boolean SKIP_UNAVAILABLE_DEFAULT
      See Also:
  • Constructor Details

    • Cluster

      public Cluster(String clusterAlias, String indexExpression, boolean skipUnavailable, String originClusterLabel)
      Create a Cluster object representing the initial RUNNING state of a Cluster.
      Parameters:
      clusterAlias - clusterAlias as defined in the remote cluster settings or RemoteClusterAware.LOCAL_CLUSTER_GROUP_KEY for the local cluster
      indexExpression - the original (not resolved/concrete) indices expression provided for this cluster.
      skipUnavailable - whether this Cluster is marked as skip_unavailable in remote cluster settings
      originClusterLabel - if clusterAlias is "" (representing the local/origin cluster), the originClusterLabel must be specified in order to know how to represent this cluster in XContent rendering. Should be "(local)" for stateful and "_origin" for serverless.
    • Cluster

      public Cluster(String clusterAlias, String indexExpression, boolean skipUnavailable, SearchResponse.Cluster.Status status, Integer totalShards, Integer successfulShards, Integer skippedShards, Integer failedShards, List<ShardSearchFailure> failures, TimeValue took, boolean timedOut, String originClusterLabel)
    • Cluster

      public Cluster(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details