Class SubmitAsyncSearchRequest

All Implemented Interfaces:
Writeable, org.elasticsearch.core.RefCounted, TaskAwareRequest

public class SubmitAsyncSearchRequest extends ActionRequest
A request to track asynchronously the progress of a search against one or more indices.
See Also:
  • Field Details

    • MIN_KEEP_ALIVE

      public static final long MIN_KEEP_ALIVE
  • Constructor Details

    • SubmitAsyncSearchRequest

      public SubmitAsyncSearchRequest(String... indices)
      Creates a new request
    • SubmitAsyncSearchRequest

      public SubmitAsyncSearchRequest(SearchSourceBuilder source, String... indices)
      Creates a new request
    • SubmitAsyncSearchRequest

      public SubmitAsyncSearchRequest(StreamInput in) throws IOException
      Throws:
      IOException
  • Method Details

    • writeTo

      public void writeTo(StreamOutput out) throws IOException
      Specified by:
      writeTo in interface Writeable
      Overrides:
      writeTo in class ActionRequest
      Throws:
      IOException
    • setBatchedReduceSize

      public SubmitAsyncSearchRequest setBatchedReduceSize(int size)
      Sets the number of shard results that should be returned to notify search progress (default to 5).
    • getBatchReduceSize

      public int getBatchReduceSize()
    • isCcsMinimizeRoundtrips

      public boolean isCcsMinimizeRoundtrips()
      Returns whether network round-trips should be minimized when executing cross-cluster search requests. Defaults to false.
    • setCcsMinimizeRoundtrips

      public void setCcsMinimizeRoundtrips(boolean ccsMinimizeRoundtrips)
      Sets whether network round-trips should be minimized when executing cross-cluster search requests. Defaults to false.

      WARNING: The progress and partial responses of searches executed on remote clusters will not be available during the search if ccsMinimizeRoundtrips is enabled.

    • setWaitForCompletionTimeout

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

      public org.elasticsearch.core.TimeValue getWaitForCompletionTimeout()
    • setKeepAlive

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

      public org.elasticsearch.core.TimeValue getKeepAlive()
    • getSearchRequest

      public SearchRequest getSearchRequest()
      Returns the underlying SearchRequest.
    • setKeepOnCompletion

      public SubmitAsyncSearchRequest setKeepOnCompletion(boolean value)
      Should the resource be kept on completion or failure (defaults to false).
    • isKeepOnCompletion

      public boolean isKeepOnCompletion()
    • validate

      Specified by:
      validate in class ActionRequest
    • createTask

      public Task createTask(long id, String type, String action, TaskId parentTaskId, Map<String,String> headers)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Object