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
,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 int
MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT
-
Constructor Summary
Constructors Constructor Description MultiSearchRequest()
MultiSearchRequest(StreamInput in)
-
Method Summary
Modifier and Type Method Description MultiSearchRequest
add(SearchRequest request)
Add a search request to execute.MultiSearchRequest
add(SearchRequestBuilder request)
Add a search request to execute.boolean
equals(java.lang.Object o)
int
hashCode()
IndicesOptions
indicesOptions()
MultiSearchRequest
indicesOptions(IndicesOptions indicesOptions)
int
maxConcurrentSearchRequests()
Returns the amount of search requests specified in this multi search requests are allowed to be ran concurrently.MultiSearchRequest
maxConcurrentSearchRequests(int maxConcurrentSearchRequests)
Sets how many search requests specified in this multi search requests are allowed to be ran concurrently.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)
java.util.List<SearchRequest>
requests()
ActionRequestValidationException
validate()
static byte[]
writeMultiLineFormat(MultiSearchRequest multiSearchRequest, XContent xContent)
static void
writeSearchRequestParams(SearchRequest request, XContentBuilder xContentBuilder)
void
writeTo(StreamOutput out)
Write this into the StreamOutput.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 Details
-
MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT
public static final int MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT- See Also:
- Constant Field Values
-
-
Constructor Details
-
MultiSearchRequest
public MultiSearchRequest() -
MultiSearchRequest
- Throws:
java.io.IOException
-
-
Method Details
-
add
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
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
Sets how many search requests specified in this multi search requests are allowed to be ran concurrently. -
requests
-
validate
- Specified by:
validate
in classActionRequest
-
indicesOptions
-
indicesOptions
-
writeTo
Description copied from interface:Writeable
Write this into the StreamOutput.- Specified by:
writeTo
in interfaceWriteable
- Overrides:
writeTo
in classActionRequest
- Throws:
java.io.IOException
-
equals
public boolean equals(java.lang.Object o)- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()- Overrides:
hashCode
in 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
-