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

# Fuzzy Search

> Client language: Java. Also available for [C#](https://docs.ravendb.net/6.2/client-api/session/querying/text-search/fuzzy-search.md), [Python](https://docs.ravendb.net/6.2/client-api/session/querying/text-search/fuzzy-search.python.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."

Fuzzy search is supported via `fuzzy` method.  
This method is available only from [DocumentQuery](https://docs.ravendb.net/6.2/client-api/session/querying/document-query/what-is-document-query.java.md) level and can only be performed on single term values.  
Because of that it can be used only right after `whereEquals` method.

## Syntax

```java
IDocumentQuery<T> fuzzy(double var1);
```

| Parameters | | |
| - | - | - |
| **fuzzy** | `double` | Value between 0.0 and 1.0 where 1.0 means closer match. |

## Example

### Java

```java
session.advanced().documentQuery(Company.class)
  .whereEquals("Name", "Ernts Hnadel")
  .fuzzy(0.5)
  .toList();
```

### RQL

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

## See also

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