---
title: "Fuzzy Search"
url: "https://docs.ravendb.net/6.2/client-api/session/querying/text-search/fuzzy-search"
version: "6.2"
language: "python"
---

# Fuzzy Search

> Client language: Python. Also available for [C#](https://docs.ravendb.net/6.2/client-api/session/querying/text-search/fuzzy-search.md), [Java](https://docs.ravendb.net/6.2/client-api/session/querying/text-search/fuzzy-search.java.md), [PHP](https://docs.ravendb.net/6.2/client-api/session/querying/text-search/fuzzy-search.php.md), [Node.js](https://docs.ravendb.net/6.2/client-api/session/querying/text-search/fuzzy-search.nodejs.md).
>
> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

> **Note**
>
> - A **fuzzy search** retrieves documents containing terms that closely match a given term instead of exact matches,
>   assisting in finding relevant results when the search term is misspelled or has minor variations.
>
> - Use the `fuzzy` method when querying with `where_equals`.
>
> - In this page:
>   - [Fuzzy search example](#fuzzy-search-example)
>   - [Syntax](#syntax)

## Fuzzy search example

### Query

```python
companies = list(
  session.advanced.document_query(object_type=Company)
  # Query with a term that is misspelled
  .where_equals("Name", "Ernts Hhandel")
  # Call 'fuzzy'
  # Pass the required similarity, a decimal param between 0.0 and 1.0
  .fuzzy(0.5)
)
# Running the above query on the Northwind sample data returns document: companies/20-A
# which contains "Ernst Handel" in its Name field.
```

### RQL

```sql
from "Companies"
where fuzzy(Name = "Ernts Hnadel", 0.5)
```

## Syntax

```python
def fuzzy(self, fuzzy: float) -> DocumentQuery[_T]: ...
```

| Parameter | Type | Description |
| - | - | - |
| **fuzzy** | `float` | A value between `0.0` and `1.0`.<br />With a value closer to `1.0`, terms with a higher similarity are matched. |

| Return Type | Description |
| - | - |
| `DocumentQuery[_T]` | The same object used for the query |

## See also

- [Query overview](https://docs.ravendb.net/6.2/client-api/session/querying/how-to-query.python.md)
- [Full-text search](https://docs.ravendb.net/6.2/client-api/session/querying/text-search/full-text-search.python.md)
- [Querying: Basics](https://docs.ravendb.net/6.2/indexes/querying/query-index.python.md)
