﻿---
title: ES|QL SET directive
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/2532/reference/query-languages/esql/commands/set
products:
  - Elasticsearch
---

# ES|QL SET directive
<applies-to>
  - Elastic Cloud Serverless: Preview since 9.3
</applies-to>

The `SET` directive can be used to specify query settings that modify the behavior of an ES|QL query.
**Syntax**
```esql
SET setting_name = setting_value[, ..., settingN = valueN]; <query>
```

Multiple SET directives can be included in a single query, separated by semicolons.
If the same setting is defined multiple times, the last definition takes precedence.
**Allowed settings**
<definitions>
  <definition term="unmapped_fields Elastic Cloud Serverless: Preview Elastic Stack: Planned">
    Defines how unmapped fields are treated. Possible values are: "FAIL" (default) - fails the query if unmapped fields are present; "NULLIFY" - treats unmapped fields as null values.  **Type**: `keyword`.
    **Example**
    Make the field null if it is unmapped.
    ```esql
    SET unmapped_fields="nullify";
    FROM employees
    | KEEP emp_*, foo
    | SORT emp_no
    | LIMIT 1
    ```
  </definition>
</definitions>


| emp_no:integer | foo:null |
|----------------|----------|
| 10001          | null     |