Package org.elasticsearch.action.search
Class MultiSearchRequestBuilder
- java.lang.Object
-
- org.elasticsearch.action.ActionRequestBuilder<MultiSearchRequest,MultiSearchResponse,MultiSearchRequestBuilder>
-
- org.elasticsearch.action.search.MultiSearchRequestBuilder
-
public class MultiSearchRequestBuilder extends ActionRequestBuilder<MultiSearchRequest,MultiSearchResponse,MultiSearchRequestBuilder>
A request builder for multiple search requests.
-
-
Field Summary
-
Fields inherited from class org.elasticsearch.action.ActionRequestBuilder
action, client, request
-
-
Constructor Summary
Constructors Constructor Description MultiSearchRequestBuilder(ElasticsearchClient client, MultiSearchAction action)
-
Method Summary
Modifier and Type Method Description MultiSearchRequestBuilder
add(SearchRequest request)
Add a search request to execute.MultiSearchRequestBuilder
add(SearchRequestBuilder request)
Add a search request to execute.MultiSearchRequestBuilder
setIndicesOptions(IndicesOptions indicesOptions)
Specifies what type of requested indices to ignore and how to deal with wildcard indices expressions.MultiSearchRequestBuilder
setMaxConcurrentSearchRequests(int maxConcurrentSearchRequests)
Sets how many search requests specified in this multi search requests are allowed to be ran concurrently.
-
-
-
Constructor Detail
-
MultiSearchRequestBuilder
public MultiSearchRequestBuilder(ElasticsearchClient client, MultiSearchAction action)
-
-
Method Detail
-
add
public MultiSearchRequestBuilder 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.If ignoreIndices has been set on the search request, then the indicesOptions of the multi search request will not be used (if set).
-
add
public MultiSearchRequestBuilder 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.
-
setIndicesOptions
public MultiSearchRequestBuilder setIndicesOptions(IndicesOptions indicesOptions)
Specifies what type of requested indices to ignore and how to deal with wildcard indices expressions. For example indices that don't exist.Invoke this method before invoking
add(SearchRequestBuilder)
.
-
setMaxConcurrentSearchRequests
public MultiSearchRequestBuilder setMaxConcurrentSearchRequests(int maxConcurrentSearchRequests)
Sets how many search requests specified in this multi search requests are allowed to be ran concurrently.
-
-