---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.6
alternate:
  - https://ydb.tech/docs/en/concepts/query_execution/fulltext_search.md?version=main
  - https://ydb.tech/docs/ru/concepts/query_execution/fulltext_search.md?version=main
sourcePath: en/core/concepts/query_execution/fulltext_search.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# Fulltext search

## Concept of fulltext search

**Fulltext search** is a way to find documents by text content in a `String` or `Utf8` column by words, phrases, and (with special indexing) by substrings. Unlike simple string predicates, fulltext search typically involves **tokenization** and **normalization** (for example, lowercasing), so queries operate on "terms" rather than raw byte substrings. Typical use cases include:

* search in product catalogs and knowledge bases
* log/message search
* searching document metadata and descriptions

The core idea of a fulltext index is an **[inverted index](https://en.wikipedia.org/wiki/Inverted_index)**: for each term, the index stores the list of documents (primary keys) that contain that term. This allows queries like "documents containing terms A and B" to avoid full table scans.

In YDB, fulltext search can be performed in two main ways:

* **without an index** — by scanning the table and applying string predicates (for example, `LIKE`). This approach is simple but does not scale well as data grows.
* **with a fulltext index** — by creating a [fulltext index](https://ydb.tech/docs/en/dev/fulltext-indexes.md?version=main) and executing queries through `VIEW IndexName`. This approach is designed for scalable search.

## Fulltext search with a fulltext index {#fulltext-search-index}

Fulltext indexes build an inverted index over a text column and allow:

* fulltext matching via [FulltextMatch](https://ydb.tech/docs/en/yql/reference/builtins/fulltext.md?version=main#fulltext-match) (query modes `Keywords` / `Query` / `Wildcard`, default operator `And` / `Or`)
* relevance ranking ([BM25](https://en.wikipedia.org/wiki/Okapi_BM25)) via [FulltextScore](https://ydb.tech/docs/en/yql/reference/builtins/fulltext.md?version=main#fulltext-score) when using [fulltext_relevance](https://ydb.tech/docs/en/dev/fulltext-indexes.md?version=main#relevance)

Search behavior (what counts as a term, case/word-form handling, wildcard support) is configured at index creation time via tokenizers and filters (for example, lowercase, Snowball stemming, n-grams). For details, see the index creation syntax [Fulltext index](https://ydb.tech/docs/en/yql/reference/syntax/create_table/fulltext_index.md?version=main).

Learn more:

* [Fulltext indexes](https://ydb.tech/docs/en/dev/fulltext-indexes.md?version=main)
* [Fulltext built-in functions](https://ydb.tech/docs/en/yql/reference/builtins/fulltext.md?version=main)
* [VIEW (Fulltext index)](https://ydb.tech/docs/en/yql/reference/syntax/select/fulltext_index.md?version=main)
