ES|QL KQL function
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is generally available and ready for production usage. Serverless interfaces and procedures might differ from classic Elastic Stack deployments. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. This functionality is in technical preview and is ready for evaluation. Use with caution in production; it is not recommended for mission-critical workloads. Elastic will work to fix any issues, but features in technical preview are not subject to the support SLA of official GA features. Specific Support terms apply. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Generally available
Stack
GA
9.1+
…
Generally available since 9.1
Preview in 9.0
Performs a KQL query and returns true if it matches the row.
query- Query string in KQL query string format.
options-
(Optional) KQL additional options as function named parameters. Available in stack version 9.3.0 and later.
Performs a KQL query. Returns true if the provided KQL query string matches the row.
Learn more about using ES|QL for search use cases.
| query | options | result |
|---|---|---|
| keyword | named parameters | boolean |
| text | named parameters | boolean |
case_insensitive- (boolean) If true, performs case-insensitive matching for keyword fields. Defaults to false.
time_zone- (keyword) UTC offset or IANA time zone used to interpret date literals in the query string.
default_field- (keyword) Default field to search if no field is provided in the query string. Supports wildcards (*).
boost-
(float) Floating point number used to decrease or increase the relevance scores of the query. Defaults to 1.0.
Use KQL to filter by a specific field value
FROM books
| WHERE KQL("author: Faulkner")
| book_no:keyword | author:text |
|---|---|
| 2378 | [Carol Faulkner, Holly Byers Ochoa, Lucretia Mott] |
| 2713 | William Faulkner |
| 2847 | Colleen Faulkner |
| 2883 | William Faulkner |
| 3293 | Danny Faulkner |
The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Stack
9.3+
Generally available since 9.3
Use KQL with additional options for case-insensitive matching and custom settings
FROM employees
| WHERE KQL("mary", {"case_insensitive": true, "default_field": "first_name", "boost": 1.5})