> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lancedb.com/llms.txt
> Use this file to discover all available pages before exploring further.

# CONTAINS_TOKENS

> The contains_tokens() scalar function: an index-accelerated keyword predicate usable directly in WHERE.

**Applies to:** Embedded ❌, Enterprise ✅

```sql SQL icon="database" theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
SELECT * FROM my_docs WHERE contains_tokens(text, 'fox jumps dog')
```

`contains_tokens(column, tokens)` is true when `column` contains **all** the
tokens in `tokens`, split on whitespace and punctuation. It is equivalent to
an [`fts()`](https://docs.lancedb.com/sql/dql/fts) match query with fuzziness off, `AND` semantics
and the simple tokenizer -- reach for it when you need a keyword test in a
`WHERE` clause and have no use for a relevance score.

**Index-accelerated.** When the column has a full-text index that suits the
query, the planner uses it instead of scanning, which is the reason to prefer
it over `LIKE` or `contains` for keyword tests. See
[`EXPLAIN`](https://docs.lancedb.com/sql/dql/explain) to confirm the plan uses the index.

## What to read next

> [card] [Full-Text Search](https://docs.lancedb.com/sql/dql/fts.md)
>
> The `fts()` table function, for relevance-ranked results and fuzzy,
> phrase, boolean, boost and multi-match queries.

> [card] [FTS Index](https://docs.lancedb.com/indexing/fts-index.md)
>
> Build the full-text index this predicate accelerates against.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.