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

    • columnar

      public final QueryRequest.Builder columnar(@Nullable Boolean value)
      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

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

      API name: delimiter

    • filter

      public final QueryRequest.Builder filter(@Nullable Query value)
      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

    • 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

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

      API name: format

    • locale

      public final QueryRequest.Builder locale(@Nullable String value)
      API name: locale
    • params

      public final QueryRequest.Builder params(List<FieldValue> list)
      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

      Adds all elements of list to params.

    • params

      public final QueryRequest.Builder params(FieldValue value, FieldValue... values)
      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

      Adds one or more values to params.

    • 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

      Adds a value to params using a builder lambda.

    • query

      public final QueryRequest.Builder query(String value)
      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

    • 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:
      NullPointerException - if some of the required fields are null.