Class QueryRequest

java.lang.Object
co.elastic.clients.elasticsearch._types.RequestBase
co.elastic.clients.elasticsearch.sql.QueryRequest
All Implemented Interfaces:
JsonpSerializable

@JsonpDeserializable public class QueryRequest extends RequestBase implements JsonpSerializable
Get SQL search results. Run an SQL request.
See Also:
  • Field Details

  • Method Details

    • of

    • allowPartialSearchResults

      @Nullable public final Boolean allowPartialSearchResults()
      If true, the response has partial results when there are shard request timeouts or shard failures. If false, the API returns an error with no partial results.

      API name: allow_partial_search_results

    • catalog

      @Nullable public final String catalog()
      The default catalog (cluster) for queries. If unspecified, the queries execute on the data in the local cluster only.

      API name: catalog

    • columnar

      @Nullable public final Boolean columnar()
      If true, the results are in a columnar fashion: one row represents all the values of a certain column from the current page of results. The API supports this parameter only for CBOR, JSON, SMILE, and YAML responses.

      API name: columnar

    • cursor

      @Nullable public final String cursor()
      The cursor used to retrieve a set of paginated results. If you specify a cursor, the API only uses the columnar and time_zone request body parameters. It ignores other request body parameters.

      API name: cursor

    • fetchSize

      @Nullable public final Integer fetchSize()
      The maximum number of rows (or entries) to return in one response.

      API name: fetch_size

    • fieldMultiValueLeniency

      @Nullable public final Boolean fieldMultiValueLeniency()
      If false, the API returns an exception when encountering multiple values for a field. If true, the API is lenient and returns the first value from the array with no guarantee of consistent results.

      API name: field_multi_value_leniency

    • filter

      @Nullable public final Query filter()
      The Elasticsearch query DSL for additional filtering.

      API name: filter

    • format

      @Nullable public final SqlFormat format()
      The format for the response. You can also specify a format using the Accept HTTP header. If you specify both this parameter and the Accept HTTP header, this parameter takes precedence.

      API name: format

    • indexUsingFrozen

      @Nullable public final Boolean indexUsingFrozen()
      If true, the search can run on frozen indices.

      API name: index_using_frozen

    • keepAlive

      @Nullable public final Time keepAlive()
      The retention period for an async or saved synchronous search.

      API name: keep_alive

    • keepOnCompletion

      @Nullable public final Boolean keepOnCompletion()
      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

      @Nullable public final Time pageTimeout()
      The minimum retention period for the scroll cursor. After this time period, a pagination request might fail because the scroll cursor is no longer available. Subsequent scroll requests prolong the lifetime of the scroll cursor by the duration of page_timeout in the scroll request.

      API name: page_timeout

    • params

      public final Map<String,JsonData> params()
      The values for parameters in the query.

      API name: params

    • query

      @Nullable public final String query()
      The SQL query to run.

      API name: query

    • requestTimeout

      @Nullable public final Time requestTimeout()
      The timeout before the request fails.

      API name: request_timeout

    • runtimeMappings

      public final Map<String,RuntimeField> runtimeMappings()
      One or more runtime fields for the search request. These fields take precedence over mapped fields with the same name.

      API name: runtime_mappings

    • timeZone

      @Nullable public final String timeZone()
      The ISO-8601 time zone ID for the search.

      API name: time_zone

    • waitForCompletionTimeout

      @Nullable public final Time waitForCompletionTimeout()
      The period to wait for complete results. It 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.

      To save a synchronous search, you must specify this parameter and the keep_on_completion parameter.

      API name: wait_for_completion_timeout

    • serialize

      public void serialize(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
      Serialize this object to JSON.
      Specified by:
      serialize in interface JsonpSerializable
    • serializeInternal

      protected void serializeInternal(jakarta.json.stream.JsonGenerator generator, JsonpMapper mapper)
    • setupQueryRequestDeserializer

      protected static void setupQueryRequestDeserializer(ObjectDeserializer<QueryRequest.Builder> op)