Module org.elasticsearch.server
Package org.elasticsearch.action.search
Class SearchResponse.Cluster
java.lang.Object
org.elasticsearch.action.search.SearchResponse.Cluster
- All Implemented Interfaces:
Writeable,ToXContent,ToXContentFragment
- Enclosing class:
SearchResponse
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classSince the Cluster object is immutable, use this Builder class to create a new Cluster object using the "copyFrom" Cluster passed in and set only changed values.static enumMarks the status of a Cluster search involved in a Cross-Cluster search.Nested classes/interfaces inherited from interface org.elasticsearch.xcontent.ToXContent
ToXContent.DelegatingMapParams, ToXContent.MapParams, ToXContent.ParamsNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ParseFieldstatic final booleanstatic final ParseFieldFields inherited from interface org.elasticsearch.xcontent.ToXContent
EMPTY, EMPTY_PARAMS -
Constructor Summary
ConstructorsConstructorDescriptionCreate a Cluster object representing the initial RUNNING state of a Cluster.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) Cluster(StreamInput in) -
Method Summary
Modifier and TypeMethodDescriptiongetTook()booleanbooleantoString()toXContent(XContentBuilder builder, ToXContent.Params params) voidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.xcontent.ToXContentFragment
isFragment
-
Field Details
-
INDICES_FIELD
-
STATUS_FIELD
-
SKIP_UNAVAILABLE_DEFAULT
public static final boolean SKIP_UNAVAILABLE_DEFAULT- See Also:
-
-
Constructor Details
-
Cluster
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 clusterindexExpression- the original (not resolved/concrete) indices expression provided for this cluster.skipUnavailable- whether this Cluster is marked as skip_unavailable in remote cluster settings
-
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) -
Cluster
- Throws:
IOException
-
-
Method Details
-
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContent
public XContentBuilder toXContent(XContentBuilder builder, ToXContent.Params params) throws IOException - Specified by:
toXContentin interfaceToXContent- Throws:
IOException
-
getClusterAlias
-
getIndexExpression
-
getStatus
-
isTimedOut
public boolean isTimedOut() -
getFailures
-
getTook
-
getTotalShards
-
getSuccessfulShards
-
getSkippedShards
-
getFailedShards
-
toString
-