# MATCH

The `MATCH` function performs a match query on the specified field. It is equivalent to the `match` query in the Elasticsearch Query DSL and can be used to search for values in various field types, including text, semantic_text, keyword, boolean, dates, and numeric types.

`MATCH` supports function named parameters to specify additional options for the match query. For a simplified syntax, the match operator `:` can be used instead of `MATCH`. The function returns `true` if the provided query matches the row.

## Syntax

`MATCH(field, query, options)`

### Parameters

#### `field`

The field that the query will target.

#### `query`

The value to find in the specified field.

#### `options`

(Optional) Additional match query options provided as function named parameters. Refer to the match query documentation for more details.

## Examples

Match on a specific field

```esql
FROM books
| WHERE MATCH(author, "Faulkner")
| KEEP book_no, author
| SORT book_no
| LIMIT 5
```

This example retrieves books where the `author` field matches "Faulkner," keeping only the `book_no` and `author` fields, sorting by `book_no`, and limiting the results to 5 rows.

Match with additional options

```esql
FROM books
| WHERE MATCH(title, "Hobbit Back Again", {"operator": "AND"})
| KEEP title
```

This example searches for books where the `title` field matches "Hobbit Back Again" using the `AND` operator, and keeps only the `title` field in the results.

Match with sorting on score

Match on a specific field

```esql
FROM books METADATA _score
| WHERE MATCH(author, "Faulkner")
| SORT _score DESC
| KEEP book_no, author
| LIMIT 5
```
