Class QueryRequest

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

@JsonpDeserializable public class QueryRequest extends RequestBase implements JsonpSerializable
Run an ES|QL query. Get search results for an ES|QL (Elasticsearch query language) query.
See Also:
  • Field Details

  • Method Details

    • of

    • columnar

      @Nullable public final Boolean columnar()
      By default, ES|QL returns results as rows. For example, FROM returns each individual document as one row. For the JSON, YAML, CBOR and smile formats, ES|QL can return the results in a columnar fashion where one row represents all the values of a certain column in the results.

      API name: columnar

    • delimiter

      @Nullable public final String delimiter()
      The character to use between values within a CSV row. Only valid for the CSV format.

      API name: delimiter

    • dropNullColumns

      @Nullable public final Boolean dropNullColumns()
      Should columns that are entirely null be removed from the columns and values portion of the results? Defaults to false. If true then the response will include an extra section under the name all_columns which has the name of all columns.

      API name: drop_null_columns

    • filter

      @Nullable public final Query filter()
      Specify a Query DSL query in the filter parameter to filter the set of documents that an ES|QL query runs on.

      API name: filter

    • format

      @Nullable public final EsqlFormat format()
      A short version of the Accept header, e.g. json, yaml.

      API name: format

    • locale

      @Nullable public final String locale()
      API name: locale
    • params

      public final List<FieldValue> params()
      To avoid any attempts of hacking or code injection, extract the values in a separate list of parameters. Use question mark placeholders (?) in the query string for each of the parameters.

      API name: params

    • profile

      @Nullable public final Boolean profile()
      If provided and true the response will include an extra profile object with information on how the query was executed. This information is for human debugging and its format can change at any time but it can give some insight into the performance of each part of the query.

      API name: profile

    • query

      public final String query()
      Required - The ES|QL query API accepts an ES|QL query string in the query parameter, runs it, and returns the results.

      API name: query

    • tables

      public final Map<String,Map<String,TableValues>> tables()
      Tables to use with the LOOKUP operation. The top level key is the table name and the next level key is the column name.

      API name: tables

    • 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)