Class QueryRequest.Builder

All Implemented Interfaces:
WithJson<QueryRequest.Builder>, ObjectBuilder<QueryRequest>
Enclosing class:
QueryRequest

public static class QueryRequest.Builder
extends RequestBase.AbstractBuilder<QueryRequest.Builder>
implements ObjectBuilder<QueryRequest>
Builder for QueryRequest.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • catalog

      public final QueryRequest.Builder catalog​(@Nullable java.lang.String value)
      Default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only.

      API name: catalog

    • columnar

      public final QueryRequest.Builder columnar​(@Nullable java.lang.Boolean value)
      API name: columnar
    • cursor

      public final QueryRequest.Builder cursor​(@Nullable java.lang.String value)
      API name: cursor
    • fetchSize

      public final QueryRequest.Builder fetchSize​(@Nullable java.lang.Integer value)
      The maximum number of rows (or entries) to return in one response

      API name: fetch_size

    • fieldMultiValueLeniency

      public final QueryRequest.Builder fieldMultiValueLeniency​(@Nullable java.lang.Boolean value)
      Throw an exception when encountering multiple values for a field (default) or be lenient and return the first value from the list (without any guarantees of what that will be - typically the first in natural ascending order).

      API name: field_multi_value_leniency

    • filter

      public final QueryRequest.Builder filter​(@Nullable Query value)
      Optional Elasticsearch query DSL for additional filtering.

      API name: filter

    • filter

      public final QueryRequest.Builder filter​(java.util.function.Function<Query.Builder,​ObjectBuilder<Query>> fn)
      Optional Elasticsearch query DSL for additional filtering.

      API name: filter

    • format

      public final QueryRequest.Builder format​(@Nullable java.lang.String value)
      a short version of the Accept header, e.g. json, yaml

      API name: format

    • indexUsingFrozen

      public final QueryRequest.Builder indexUsingFrozen​(@Nullable java.lang.Boolean value)
      If true, the search can run on frozen indices. Defaults to false.

      API name: index_using_frozen

    • keepAlive

      public final QueryRequest.Builder keepAlive​(@Nullable Time value)
      Retention period for an async or saved synchronous search.

      API name: keep_alive

    • keepAlive

      public final QueryRequest.Builder keepAlive​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      Retention period for an async or saved synchronous search.

      API name: keep_alive

    • keepOnCompletion

      public final QueryRequest.Builder keepOnCompletion​(@Nullable java.lang.Boolean value)
      If true, Elasticsearch stores synchronous searches if you also specify the wait_for_completion_timeout parameter. If false, Elasticsearch only stores async searches that don’t finish before the wait_for_completion_timeout.

      API name: keep_on_completion

    • pageTimeout

      public final QueryRequest.Builder pageTimeout​(@Nullable Time value)
      The timeout before a pagination request fails.

      API name: page_timeout

    • pageTimeout

      public final QueryRequest.Builder pageTimeout​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      The timeout before a pagination request fails.

      API name: page_timeout

    • params

      public final QueryRequest.Builder params​(java.util.Map<java.lang.String,​JsonData> map)
      Values for parameters in the query.

      API name: params

      Adds all entries of map to params.

    • params

      public final QueryRequest.Builder params​(java.lang.String key, JsonData value)
      Values for parameters in the query.

      API name: params

      Adds an entry to params.

    • query

      public final QueryRequest.Builder query​(@Nullable java.lang.String value)
      SQL query to execute

      API name: query

    • requestTimeout

      public final QueryRequest.Builder requestTimeout​(@Nullable Time value)
      The timeout before the request fails.

      API name: request_timeout

    • requestTimeout

      public final QueryRequest.Builder requestTimeout​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      The timeout before the request fails.

      API name: request_timeout

    • runtimeMappings

      public final QueryRequest.Builder runtimeMappings​(java.util.Map<java.lang.String,​RuntimeField> map)
      Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

      API name: runtime_mappings

      Adds all entries of map to runtimeMappings.

    • runtimeMappings

      public final QueryRequest.Builder runtimeMappings​(java.lang.String key, RuntimeField value)
      Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

      API name: runtime_mappings

      Adds an entry to runtimeMappings.

    • runtimeMappings

      public final QueryRequest.Builder runtimeMappings​(java.lang.String key, java.util.function.Function<RuntimeField.Builder,​ObjectBuilder<RuntimeField>> fn)
      Defines one or more runtime fields in the search request. These fields take precedence over mapped fields with the same name.

      API name: runtime_mappings

      Adds an entry to runtimeMappings using a builder lambda.

    • timeZone

      public final QueryRequest.Builder timeZone​(@Nullable java.lang.String value)
      Time-zone in ISO 8601 used for executing the query on the server. More information available here.

      API name: time_zone

    • waitForCompletionTimeout

      public final QueryRequest.Builder waitForCompletionTimeout​(@Nullable Time value)
      Period to wait for complete results. Defaults to no timeout, meaning the request waits for complete search results. If the search doesn’t finish within this period, the search becomes async.

      API name: wait_for_completion_timeout

    • waitForCompletionTimeout

      public final QueryRequest.Builder waitForCompletionTimeout​(java.util.function.Function<Time.Builder,​ObjectBuilder<Time>> fn)
      Period to wait for complete results. Defaults to no timeout, meaning the request waits for complete search results. If the search doesn’t finish within this period, the search becomes async.

      API name: wait_for_completion_timeout

    • self

      protected QueryRequest.Builder self()
      Specified by:
      self in class RequestBase.AbstractBuilder<QueryRequest.Builder>
    • build

      public QueryRequest build()
      Builds a QueryRequest.
      Specified by:
      build in interface ObjectBuilder<QueryRequest>
      Throws:
      java.lang.NullPointerException - if some of the required fields are null.