Package org.elasticsearch.action.search
Class MultiSearchRequest
- java.lang.Object
-
- org.elasticsearch.transport.TransportMessage
-
- org.elasticsearch.transport.TransportRequest
-
- org.elasticsearch.action.ActionRequest
-
- org.elasticsearch.action.search.MultiSearchRequest
-
- All Implemented Interfaces:
CompositeIndicesRequest,Streamable,Writeable,TaskAwareRequest
public class MultiSearchRequest extends ActionRequest implements CompositeIndicesRequest
A multi search API request.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.elasticsearch.transport.TransportRequest
TransportRequest.Empty
-
Nested classes/interfaces inherited from interface org.elasticsearch.common.io.stream.Writeable
Writeable.Reader<V>, Writeable.Writer<V>
-
-
Field Summary
Fields Modifier and Type Field Description static intMAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT
-
Constructor Summary
Constructors Constructor Description MultiSearchRequest()
-
Method Summary
Modifier and Type Method Description MultiSearchRequestadd(SearchRequest request)Add a search request to execute.MultiSearchRequestadd(SearchRequestBuilder request)Add a search request to execute.booleanequals(java.lang.Object o)inthashCode()IndicesOptionsindicesOptions()MultiSearchRequestindicesOptions(IndicesOptions indicesOptions)intmaxConcurrentSearchRequests()Returns the amount of search requests specified in this multi search requests are allowed to be ran concurrently.MultiSearchRequestmaxConcurrentSearchRequests(int maxConcurrentSearchRequests)Sets how many search requests specified in this multi search requests are allowed to be ran concurrently.voidreadFrom(StreamInput in)Set this object's fields from a StreamInput.static voidreadMultiLineFormat(BytesReference data, XContent xContent, CheckedBiConsumer<SearchRequest,XContentParser,java.io.IOException> consumer, java.lang.String[] indices, IndicesOptions indicesOptions, java.lang.String[] types, java.lang.String routing, java.lang.String searchType, java.lang.Boolean ccsMinimizeRoundtrips, NamedXContentRegistry registry, boolean allowExplicitIndex, DeprecationLogger deprecationLogger)java.util.List<SearchRequest>requests()ActionRequestValidationExceptionvalidate()static byte[]writeMultiLineFormat(MultiSearchRequest multiSearchRequest, XContent xContent)static voidwriteSearchRequestParams(SearchRequest request, XContentBuilder xContentBuilder)voidwriteTo(StreamOutput out)Write this object's fields to a StreamOutput.-
Methods inherited from class org.elasticsearch.action.ActionRequest
getShouldStoreResult
-
Methods inherited from class org.elasticsearch.transport.TransportRequest
getParentTask, setParentTask
-
Methods inherited from class org.elasticsearch.transport.TransportMessage
remoteAddress, remoteAddress
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.elasticsearch.tasks.TaskAwareRequest
createTask, getDescription, setParentTask
-
-
-
-
Field Detail
-
MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT
public static final int MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT
- See Also:
- Constant Field Values
-
-
Method Detail
-
add
public MultiSearchRequest add(SearchRequestBuilder request)
Add a search request to execute. Note, the order is important, the search response will be returned in the same order as the search requests.
-
add
public MultiSearchRequest add(SearchRequest request)
Add a search request to execute. Note, the order is important, the search response will be returned in the same order as the search requests.
-
maxConcurrentSearchRequests
public int maxConcurrentSearchRequests()
Returns the amount of search requests specified in this multi search requests are allowed to be ran concurrently.
-
maxConcurrentSearchRequests
public MultiSearchRequest maxConcurrentSearchRequests(int maxConcurrentSearchRequests)
Sets how many search requests specified in this multi search requests are allowed to be ran concurrently.
-
requests
public java.util.List<SearchRequest> requests()
-
validate
public ActionRequestValidationException validate()
- Specified by:
validatein classActionRequest
-
indicesOptions
public IndicesOptions indicesOptions()
-
indicesOptions
public MultiSearchRequest indicesOptions(IndicesOptions indicesOptions)
-
readFrom
public void readFrom(StreamInput in) throws java.io.IOException
Description copied from interface:StreamableSet this object's fields from a StreamInput.- Specified by:
readFromin interfaceStreamable- Overrides:
readFromin classActionRequest- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:StreamableWrite this object's fields to a StreamOutput.- Specified by:
writeToin interfaceStreamable- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classActionRequest- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
readMultiLineFormat
public static void readMultiLineFormat(BytesReference data, XContent xContent, CheckedBiConsumer<SearchRequest,XContentParser,java.io.IOException> consumer, java.lang.String[] indices, IndicesOptions indicesOptions, java.lang.String[] types, java.lang.String routing, java.lang.String searchType, java.lang.Boolean ccsMinimizeRoundtrips, NamedXContentRegistry registry, boolean allowExplicitIndex, DeprecationLogger deprecationLogger) throws java.io.IOException
- Throws:
java.io.IOException
-
writeMultiLineFormat
public static byte[] writeMultiLineFormat(MultiSearchRequest multiSearchRequest, XContent xContent) throws java.io.IOException
- Throws:
java.io.IOException
-
writeSearchRequestParams
public static void writeSearchRequestParams(SearchRequest request, XContentBuilder xContentBuilder) throws java.io.IOException
- Throws:
java.io.IOException
-
-