Class QuerySettings

java.lang.Object
org.elasticsearch.xpack.esql.plan.QuerySettings

public final class QuerySettings extends Object
The catalog of registered ES|QL query settings.

Each entry is one fluent declaration. QuerySettingDef carries the schema and the read API; this class is a list of constants and two utility methods (validate(org.elasticsearch.xpack.esql.plan.EsqlStatement, org.elasticsearch.xpack.esql.plan.SettingsValidationContext) for the in-query SET pass, resolve(java.util.Map<org.elasticsearch.xpack.esql.plan.QuerySettingDef<?>, java.lang.Object>, org.elasticsearch.xpack.esql.plan.EsqlStatement, org.elasticsearch.xpack.esql.plan.SettingsValidationContext) for the merge step that produces an ResolvedSettings).

Adding a new setting


   public static final QuerySettingDef<String> MY_SETTING = QuerySettingDef
       .string("my_setting")
       .withDefault("foo")
       .withRequestBody()       // accept under settings.{my_setting}
       .build();
 
Then add the constant to ALL to register it. Read anywhere via MY_SETTING.get(resolvedSettings).
  • Field Details

    • PROJECT_ROUTING

      public static final QuerySettingDef<String> PROJECT_ROUTING
    • TIME_ZONE

      public static final QuerySettingDef<ZoneId> TIME_ZONE
    • UNMAPPED_FIELDS

      public static final QuerySettingDef<UnmappedResolution> UNMAPPED_FIELDS
    • COLUMN_METADATA

      public static final QuerySettingDef<Boolean> COLUMN_METADATA
    • APPROXIMATION

      public static final QuerySettingDef<ApproximationSettings> APPROXIMATION
    • ALL

      public static final List<QuerySettingDef<?>> ALL
      The canonical, explicitly-enumerated set of all query settings. This is the single source of truth — the request parser, the resolver, and telemetry all iterate this list. Add a new setting's constant here when you declare it. Referencing this field initializes the class, so there is no load-order hazard.
  • Method Details