Class SubmitAsyncSearchRequest

java.lang.Object
org.elasticsearch.client.asyncsearch.SubmitAsyncSearchRequest
All Implemented Interfaces:
Validatable

public class SubmitAsyncSearchRequest extends Object implements Validatable
A request to track asynchronously the progress of a search against one or more indices.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static long
     

    Fields inherited from interface org.elasticsearch.client.Validatable

    EMPTY
  • Constructor Summary

    Constructors
    Constructor
    Description
    SubmitAsyncSearchRequest(org.elasticsearch.search.builder.SearchSourceBuilder source, String... indices)
    Creates a new request
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    Gets if this request should allow partial results.
    Gets the number of shard results that should be reduced at once on the coordinating node.
    Get the target indices
    org.elasticsearch.action.support.IndicesOptions
    Get the indices Options.
    org.elasticsearch.core.TimeValue
    Get the amount of time after which the result will expire (defaults to 5 days).
    int
    Returns the number of shard requests that should be executed concurrently on a single node.
    Get the preference to execute the search.
    Gets if this request should use the request cache or not, if set.
    Get the routing value to control the shards that the search will be executed on.
    org.elasticsearch.search.builder.SearchSourceBuilder
    Gets if the source of the SearchSourceBuilder initially used on this request.
    org.elasticsearch.action.search.SearchType
    Get the search type to execute, defaults to SearchType.DEFAULT.
    org.elasticsearch.core.TimeValue
    Get the minimum time that the request should wait before returning a partial result (defaults to 1 second).
    int
     
    Returns whether the resource resource should be kept on completion or failure (defaults to false).
    void
    setAllowPartialSearchResults(boolean allowPartialSearchResults)
    Sets if this request should allow partial results.
    void
    setBatchedReduceSize(int batchedReduceSize)
    Optional.
    void
    setIndicesOptions(org.elasticsearch.action.support.IndicesOptions indicesOptions)
    Specifies what type of requested indices to ignore and how to deal with indices wildcard expressions.
    void
    setKeepAlive(org.elasticsearch.core.TimeValue keepAlive)
    Sets the amount of time after which the result will expire (defaults to 5 days).
    void
    setKeepOnCompletion(boolean keepOnCompletion)
    Determines if the resource should be kept on completion or failure (defaults to false).
    void
    setMaxConcurrentShardRequests(int maxConcurrentShardRequests)
    Sets the number of shard requests that should be executed concurrently on a single node.
    void
    setPreference(String preference)
    Sets the preference to execute the search.
    void
    setRequestCache(Boolean requestCache)
    Sets if this request should use the request cache or not, assuming that it can (for example, if "now" is used, it will never be cached).
    void
    setRouting(String routing)
    Set the routing value to control the shards that the search will be executed on.
    void
    setRoutings(String... routings)
    Set the routing values to control the shards that the search will be executed on.
    void
    setSearchType(org.elasticsearch.action.search.SearchType searchType)
    The search type to execute, defaults to SearchType.DEFAULT.
    void
    setWaitForCompletionTimeout(org.elasticsearch.core.TimeValue waitForCompletionTimeout)
    Sets the minimum time that the request should wait before returning a partial result (defaults to 1 second).
    Perform validation.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MIN_KEEP_ALIVE

      public static long MIN_KEEP_ALIVE
  • Constructor Details

    • SubmitAsyncSearchRequest

      public SubmitAsyncSearchRequest(org.elasticsearch.search.builder.SearchSourceBuilder source, String... indices)
      Creates a new request
  • Method Details

    • getIndices

      public String[] getIndices()
      Get the target indices
    • getWaitForCompletionTimeout

      public org.elasticsearch.core.TimeValue getWaitForCompletionTimeout()
      Get the minimum time that the request should wait before returning a partial result (defaults to 1 second).
    • setWaitForCompletionTimeout

      public void setWaitForCompletionTimeout(org.elasticsearch.core.TimeValue waitForCompletionTimeout)
      Sets the minimum time that the request should wait before returning a partial result (defaults to 1 second).
    • isKeepOnCompletion

      public Boolean isKeepOnCompletion()
      Returns whether the resource resource should be kept on completion or failure (defaults to false).
    • setKeepOnCompletion

      public void setKeepOnCompletion(boolean keepOnCompletion)
      Determines if the resource should be kept on completion or failure (defaults to false).
    • getKeepAlive

      public org.elasticsearch.core.TimeValue getKeepAlive()
      Get the amount of time after which the result will expire (defaults to 5 days).
    • setKeepAlive

      public void setKeepAlive(org.elasticsearch.core.TimeValue keepAlive)
      Sets the amount of time after which the result will expire (defaults to 5 days).
    • setRouting

      public void setRouting(String routing)
      Set the routing value to control the shards that the search will be executed on. A comma separated list of routing values to control the shards the search will be executed on.
    • setRoutings

      public void setRoutings(String... routings)
      Set the routing values to control the shards that the search will be executed on.
    • getRouting

      public String getRouting()
      Get the routing value to control the shards that the search will be executed on.
    • setPreference

      public void setPreference(String preference)
      Sets the preference to execute the search. Defaults to randomize across shards. Can be set to _local to prefer local shards or a custom value, which guarantees that the same order will be used across different requests.
    • getPreference

      public String getPreference()
      Get the preference to execute the search.
    • setIndicesOptions

      public void setIndicesOptions(org.elasticsearch.action.support.IndicesOptions indicesOptions)
      Specifies what type of requested indices to ignore and how to deal with indices wildcard expressions.
    • getIndicesOptions

      public org.elasticsearch.action.support.IndicesOptions getIndicesOptions()
      Get the indices Options.
    • setSearchType

      public void setSearchType(org.elasticsearch.action.search.SearchType searchType)
      The search type to execute, defaults to SearchType.DEFAULT.
    • getSearchType

      public org.elasticsearch.action.search.SearchType getSearchType()
      Get the search type to execute, defaults to SearchType.DEFAULT.
    • setAllowPartialSearchResults

      public void setAllowPartialSearchResults(boolean allowPartialSearchResults)
      Sets if this request should allow partial results. (If method is not called, will default to the cluster level setting).
    • getAllowPartialSearchResults

      public Boolean getAllowPartialSearchResults()
      Gets if this request should allow partial results.
    • setBatchedReduceSize

      public void setBatchedReduceSize(int batchedReduceSize)
      Optional. Sets the number of shard results that should be reduced at once on the coordinating node. This value should be used as a protection mechanism to reduce the memory overhead per search request if the potential number of shards in the request can be large. Defaults to 5.
    • getBatchedReduceSize

      public Integer getBatchedReduceSize()
      Gets the number of shard results that should be reduced at once on the coordinating node. Returns null if unset.
    • setRequestCache

      public void setRequestCache(Boolean requestCache)
      Sets if this request should use the request cache or not, assuming that it can (for example, if "now" is used, it will never be cached). By default (if not set) this is turned on for SubmitAsyncSearchRequest.
    • getRequestCache

      public Boolean getRequestCache()
      Gets if this request should use the request cache or not, if set. This defaults to `true` on the server side if unset in the client.
    • getMaxConcurrentShardRequests

      public int getMaxConcurrentShardRequests()
      Returns the number of shard requests that should be executed concurrently on a single node. The default is 5.
    • setMaxConcurrentShardRequests

      public void setMaxConcurrentShardRequests(int maxConcurrentShardRequests)
      Sets the number of shard requests that should be executed concurrently on a single node. The default is 5.
    • getSearchSource

      public org.elasticsearch.search.builder.SearchSourceBuilder getSearchSource()
      Gets if the source of the SearchSourceBuilder initially used on this request.
    • validate

      public Optional<ValidationException> validate()
      Description copied from interface: Validatable
      Perform validation. This method does not have to be overridden in the event that no validation needs to be done, or the validation was done during object construction time. A ValidationException that is not null is assumed to contain validation errors and will be thrown.
      Specified by:
      validate in interface Validatable
      Returns:
      An Optional ValidationException that contains a list of validation errors.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object