﻿---
title: ES|QL MV_LIKE function
description: 
url: https://www.elastic.co/elastic/docs-builder/docs/3717/reference/query-languages/esql/functions-operators/mv-functions/mv_like
products:
  - Elasticsearch
---

# ES|QL MV_LIKE function
<applies-to>
  - Elastic Cloud Serverless: Preview
  - Elastic Stack: Planned
</applies-to>

Checks if any value of a multivalue field matches a wildcard pattern.

## Syntax

![Embedded](https://www.elastic.co/elastic/docs-builder/docs/3717/reference/query-languages/esql/images/generated/x-pack-esql/functions/mv_like.svg)


## Parameters

<definitions>
  <definition term="field">
    Multivalue expression to test. If null or empty, the function returns `false`.
  </definition>
  <definition term="pattern">
    Wildcard pattern. Must be a constant. `*` matches any run of characters, `?` matches a single character; escape either with `\`.
  </definition>
</definitions>


## Description

Returns `true` when any value yielded by `field` matches `pattern`, using the same wildcard syntax as `LIKE`. `LIKE` is a single-value scalar: applied to a multivalue field it emits a warning and returns `null`, so this is how you match a wildcard pattern against a multivalue field. A null or empty `field` returns `false`, and because the result is never null the predicate composes under `AND`/`OR`/`NOT`.

## Supported types


| field   | pattern | result  |
|---------|---------|---------|
| keyword | keyword | boolean |
| keyword | text    | boolean |
| text    | keyword | boolean |
| text    | text    | boolean |


## Examples

```esql
ROW names = ["Anna", "Bob", "Carl"]
| EVAL any_starts_with_a = mv_like(names, "A*")
```


| names:keyword     | any_starts_with_a:boolean |
|-------------------|---------------------------|
| [Anna, Bob, Carl] | true                      |

A prefix pattern matches when any value starts with the literal:
```esql
ROW names = ["Anna", "Bob"]
| EVAL has_bo = mv_like(names, "Bo*")
```


| names:keyword | has_bo:boolean |
|---------------|----------------|
| [Anna, Bob]   | true           |

Because the result is never null, it composes under `NOT`:
```esql
ROW names = ["Anna", "Bob"]
| EVAL no_carl = NOT mv_like(names, "Carl*")
```


| names:keyword | no_carl:boolean |
|---------------|-----------------|
| [Anna, Bob]   | true            |