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 int
MAX_CONCURRENT_SEARCH_REQUESTS_DEFAULT
-
Constructor Summary
Constructors Constructor Description MultiSearchRequest()
-
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.void
readFrom(StreamInput in)
Set this object's fields from a StreamInput.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, NamedXContentRegistry registry, boolean allowExplicitIndex)
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 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:
validate
in 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:Streamable
Set this object's fields from a StreamInput.- Specified by:
readFrom
in interfaceStreamable
- Overrides:
readFrom
in classActionRequest
- Throws:
java.io.IOException
-
writeTo
public void writeTo(StreamOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write this object's fields to a StreamOutput.- Specified by:
writeTo
in interfaceStreamable
- 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, NamedXContentRegistry registry, boolean allowExplicitIndex) 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
-
-