﻿---
title: ES|QL CONTAINS function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/2841/reference/query-languages/esql/functions-operators/string-functions/contains
products:
  - Elasticsearch
---

# ES|QL CONTAINS function
<applies-to>
  - Elastic Stack: Generally available since 9.2
</applies-to>


## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/2841/reference/query-languages/esql/images/functions/contains.svg)


## Parameters

<definitions>
  <definition term="string">
    String expression: input string to check against. If `null`, the function returns `null`.
  </definition>
  <definition term="substring">
    String expression: A substring to find in the input string. If `null`, the function returns `null`.
  </definition>
</definitions>


## Description

Returns a boolean that indicates whether a keyword substring is within another string. Returns `null` if either parameter is null.

## Supported types


| string  | substring | result  |
|---------|-----------|---------|
| keyword | keyword   | boolean |
| keyword | text      | boolean |
| text    | keyword   | boolean |
| text    | text      | boolean |


## Example

```esql
ROW a = "hello"
| EVAL has_ll = CONTAINS(a, "ll")
```


| a:keyword | has_ll:boolean |
|-----------|----------------|
| hello     | true           |