congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CountRequest.toSearchRequest
Code IndexAdd Tabnine to your IDE (free)

How to use
toSearchRequest
method
in
org.elasticsearch.action.count.CountRequest

Best Java code snippets using org.elasticsearch.action.count.CountRequest.toSearchRequest (Showing top 5 results out of 315)

origin: harbby/presto-connectors

@Override
public void execute(ActionListener<CountResponse> listener) {
  CountRequest countRequest = beforeExecute(request);
  client.execute(SearchAction.INSTANCE, countRequest.toSearchRequest(), new DelegatingActionListener<SearchResponse, CountResponse>(listener) {
    @Override
    protected CountResponse getDelegatedFromInstigator(SearchResponse response) {
      return new CountResponse(response);
    }
  });
}
origin: harbby/presto-connectors

@Override
public void count(final CountRequest request, final ActionListener<CountResponse> listener) {
  deprecationLogger.deprecated("the count api is deprecated and will be removed from the java api in the next major version");
  execute(SearchAction.INSTANCE, request.toSearchRequest(), new DelegatingActionListener<SearchResponse, CountResponse>(listener) {
    @Override
    protected CountResponse getDelegatedFromInstigator(SearchResponse response) {
      return new CountResponse(response);
    }
  });
}
origin: harbby/presto-connectors

@Override
public ActionFuture<CountResponse> count(final CountRequest request) {
  AdapterActionFuture<CountResponse, SearchResponse> actionFuture = new AdapterActionFuture<CountResponse, SearchResponse>() {
    @Override
    protected CountResponse convert(SearchResponse listenerResponse) {
      return new CountResponse(listenerResponse);
    }
  };
  deprecationLogger.deprecated("the count api is deprecated and will be removed from the java api in the next major version");
  execute(SearchAction.INSTANCE, request.toSearchRequest(), actionFuture);
  return actionFuture;
}
origin: harbby/presto-connectors

@Override
public void doRequest(final RestRequest request, final RestChannel channel, final Client client) {
  String[] indices = Strings.splitStringByCommaToArray(request.param("index"));
  CountRequest countRequest = new CountRequest(indices);
  String source = request.param("source");
  if (source != null) {
    countRequest.source(source);
  } else {
    QuerySourceBuilder querySourceBuilder = RestActions.parseQuerySource(request);
    if (querySourceBuilder != null) {
      countRequest.source(querySourceBuilder);
    }
  }
  client.search(countRequest.toSearchRequest(), new RestResponseListener<SearchResponse>(channel) {
    @Override
    public RestResponse buildResponse(SearchResponse countResponse) throws Exception {
      return RestTable.buildResponse(buildTable(request, countResponse), channel);
    }
  });
}
origin: harbby/presto-connectors

  countRequest.terminateAfter(terminateAfter);
client.search(countRequest.toSearchRequest(), new RestBuilderListener<SearchResponse>(channel) {
  @Override
  public RestResponse buildResponse(SearchResponse response, XContentBuilder builder) throws Exception {
org.elasticsearch.action.countCountRequesttoSearchRequest

Popular methods of CountRequest

  • <init>
    Constructs a new count request against the provided indices. No indices provided means it will run a
  • indices
  • minScore
    The minimum score of the documents to include in the count. Defaults to -1 which means all documents
  • preference
  • routing
    The routing values to control the shards that the search will be executed on.
  • types
    The types of documents the query will run against. Defaults to all types.
  • indicesOptions
  • query
  • source
    The source to execute.
  • terminateAfter
    Upon reaching terminateAfter counts, the count request will early terminate

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • Socket (java.net)
    Provides a client-side TCP socket.
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Logger (org.apache.log4j)
    This is the central class in the log4j package. Most logging operations, except configuration, are d
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now