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 intMAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT
-
Constructor Summary
Constructors Constructor Description MultiSearchRequest()MultiSearchRequest(StreamInput in)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiSearchRequestadd(SearchRequest request)Add a search request to execute.MultiSearchRequestadd(SearchRequestBuilder request)Add a search request to execute.booleanequals(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.static voidreadMultiLineFormat(BytesReference data, XContent xContent, CheckedBiConsumer<SearchRequest,XContentParser,IOException> consumer, String[] indices, IndicesOptions indicesOptions, String[] types, String routing, String searchType, Boolean ccsMinimizeRoundtrips, NamedXContentRegistry registry, boolean allowExplicitIndex, DeprecationLogger deprecationLogger)List<SearchRequest>requests()ActionRequestValidationExceptionvalidate()static byte[]writeMultiLineFormat(MultiSearchRequest multiSearchRequest, XContent xContent)static voidwriteSearchRequestParams(SearchRequest request, XContentBuilder xContentBuilder)voidwriteTo(StreamOutput out)Write this into the 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
-
-
Constructor Detail
-
MultiSearchRequest
public MultiSearchRequest()
-
MultiSearchRequest
public MultiSearchRequest(StreamInput in) throws IOException
- Throws:
IOException
-
-
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 List<SearchRequest> requests()
-
validate
public ActionRequestValidationException validate()
- Specified by:
validatein classActionRequest
-
indicesOptions
public IndicesOptions indicesOptions()
-
indicesOptions
public MultiSearchRequest indicesOptions(IndicesOptions indicesOptions)
-
writeTo
public void writeTo(StreamOutput out) throws IOException
Description copied from interface:WriteableWrite this into the StreamOutput.- Specified by:
writeToin interfaceWriteable- Overrides:
writeToin classActionRequest- Throws:
IOException
-
readMultiLineFormat
public static void readMultiLineFormat(BytesReference data, XContent xContent, CheckedBiConsumer<SearchRequest,XContentParser,IOException> consumer, String[] indices, IndicesOptions indicesOptions, String[] types, String routing, String searchType, Boolean ccsMinimizeRoundtrips, NamedXContentRegistry registry, boolean allowExplicitIndex, DeprecationLogger deprecationLogger) throws IOException
- Throws:
IOException
-
writeMultiLineFormat
public static byte[] writeMultiLineFormat(MultiSearchRequest multiSearchRequest, XContent xContent) throws IOException
- Throws:
IOException
-
writeSearchRequestParams
public static void writeSearchRequestParams(SearchRequest request, XContentBuilder xContentBuilder) throws IOException
- Throws:
IOException
-
-