java.lang.Object
org.elasticsearch.transport.TransportMessage
org.elasticsearch.transport.TransportResponse
org.elasticsearch.action.ActionResponse
org.elasticsearch.action.search.MultiSearchResponse
- All Implemented Interfaces:
Iterable<MultiSearchResponse.Item>,Writeable,ChunkedToXContent,ChunkedToXContentObject,RefCounted
public class MultiSearchResponse
extends ActionResponse
implements Iterable<MultiSearchResponse.Item>, ChunkedToXContentObject
A multi search response.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic classA search response item, holding the actual search response, or an error message if it failed.Nested classes/interfaces inherited from class org.elasticsearch.action.ActionResponse
ActionResponse.EmptyNested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V> -
Field Summary
Fields inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
EMPTYFields inherited from interface org.elasticsearch.core.RefCounted
ALWAYS_REFERENCED -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandecRef()Note that the lifetime of an outboundTransportMessagelasts at least until it has been fully sent over the network, and it may be closed on a network thread in a context in which there's a risk of stack overflows if on close it calls back into the network layer in a manner that might end up nesting too deeply.The list of responses, the order is the same as the one provided in the request.getTook()How long the msearch took.booleanvoidincRef()iterator()toString()Iterator<? extends ToXContent> toXContentChunked(ToXContent.Params params) Create an iterator ofToXContentchunks for a REST response.booleanvoidwriteTo(StreamOutput out) Write this into the StreamOutput.Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddressMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContent
toXContentChunked, toXContentChunkedV8Methods inherited from interface org.elasticsearch.common.xcontent.ChunkedToXContentObject
isFragmentMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.elasticsearch.core.RefCounted
mustIncRef
-
Constructor Details
-
MultiSearchResponse
- Throws:
IOException
-
MultiSearchResponse
- Parameters:
items- individual search responses, the elements in this array are considered as owned by this instance for ref-counting purposes if theirMultiSearchResponse.Item.responseis non-null
-
-
Method Details
-
incRef
public void incRef()- Specified by:
incRefin interfaceRefCounted- Overrides:
incRefin classTransportMessage
-
tryIncRef
public boolean tryIncRef()- Specified by:
tryIncRefin interfaceRefCounted- Overrides:
tryIncRefin classTransportMessage
-
decRef
public boolean decRef()Description copied from class:TransportMessageNote that the lifetime of an outboundTransportMessagelasts at least until it has been fully sent over the network, and it may be closed on a network thread in a context in which there's a risk of stack overflows if on close it calls back into the network layer in a manner that might end up nesting too deeply. When in doubt, dispatch any further work onto a separate thread.- Specified by:
decRefin interfaceRefCounted- Overrides:
decRefin classTransportMessage
-
hasReferences
public boolean hasReferences()- Specified by:
hasReferencesin interfaceRefCounted- Overrides:
hasReferencesin classTransportMessage
-
iterator
- Specified by:
iteratorin interfaceIterable<MultiSearchResponse.Item>
-
getResponses
The list of responses, the order is the same as the one provided in the request. -
getTook
How long the msearch took. -
writeTo
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Throws:
IOException
-
toXContentChunked
Description copied from interface:ChunkedToXContentCreate an iterator ofToXContentchunks for a REST response. Each chunk is serialized with the sameXContentBuilderandToXContent.Params, which is also the same as theToXContent.Paramspassed as theparamsargument. For best results, all chunks should beO(1)size. The last chunk in the iterator must always yield at least one byte of output. See alsoChunkedToXContentHelperfor some handy utilities.Note that chunked response bodies cannot send deprecation warning headers once transmission has started, so implementations must check for deprecated feature use before returning.
- Specified by:
toXContentChunkedin interfaceChunkedToXContent- Returns:
- iterator over chunks of
ToXContent
-
toString
-