Session: Querying: How to Use Fuzzy

Fuzzy search is supported via Fuzzy method. This method is available only from DocumentQuery level and can only be performed on single term values. Because of that it can be used only right after WhereEquals method.

Syntax

IDocumentQuery<T> Fuzzy(decimal fuzzy);
Parameters
fuzzy decimal Value between 0.0 and 1.0 where 1.0 means closer match.

Example

session
    .Advanced
    .DocumentQuery<Company>()
    .WhereEquals(x => x.Name, "Ernts Hnadel").Fuzzy(0.5m)
    .ToList();
session
    .Advanced
    .AsyncDocumentQuery<Company>()
    .WhereEquals(x => x.Name, "Ernts Hnadel").Fuzzy(0.5m)
    .ToListAsync();
from Companies
where fuzzy(Name = 'Ernts Hnadel', 0.5)