Glossary

Fuzzy search

Fuzzy search is a search technique that finds approximate matches for a query, so that misspellings, typos and small variations in a word still return the right results.

Fuzzy search is a way of matching text that returns results which are close to the query rather than identical to it. A fuzzy search for “recieve” finds “receive”, “Jonh Smith” finds “John Smith”, and “kubernets” finds “Kubernetes”. Most fuzzy search measures closeness as edit distance, the number of single-character changes needed to turn one string into another, and accepts any term within a set limit. It is the standard way search engines, autocomplete boxes and data-matching tools cope with spelling mistakes, keyboard slips and inconsistent data.

How fuzzy matching works

The most common measure is Levenshtein distance. It counts the minimum number of insertions, deletions and substitutions needed to turn one word into another. “Cat” to “cart” is one insertion, so the distance is 1. “Kitten” to “sitting” is three edits: two substitutions and one insertion. Damerau-Levenshtein distance adds transposition of two adjacent characters as a single edit, which matters because swapped letters such as “teh” for “the” are one of the most common typing errors.

A fuzzy query sets a maximum distance, often written as “fuzziness”. Distance 1 catches most single typos; distance 2 catches more but starts to match unrelated words. Short words need tighter limits than long ones, because two edits to a four-letter word can turn it into almost anything. Many engines therefore scale fuzziness by term length: no edits allowed for very short terms, one edit for medium terms and two for longer ones.

Checking every word in a large index against the query would be slow, so engines precompute structures that make this fast. Lucene, which sits under Elasticsearch, OpenSearch and Solr, builds a Levenshtein automaton for the query term and walks the term dictionary with it, visiting only terms that could be within the edit limit. Other systems index character n-grams, short overlapping slices of each word, and find candidates that share enough n-grams with the query before scoring them properly.

A worked example

Suppose a support knowledge base has an article titled “Resetting two-factor authentication”, and a user types “reseting two factor authentification”. An exact keyword search matches “two” and “factor” at best, because “reseting” and “authentification” do not appear in the inverted index. With fuzzy matching at distance 1 or 2, “reseting” matches “resetting” (one insertion) and “authentification” matches “authentication” (two deletions), and the article ranks first.

The cost shows up on other queries. A fuzzy search for “form” at distance 1 also matches “from”, “farm”, “fork” and “norm”. In a product catalogue, a search for the SKU “AB-1200” at distance 1 can match “AB-1201” and “AB-1300”, which is the wrong behaviour for an exact identifier. Good setups rank exact matches above fuzzy ones, and turn fuzziness off for fields that hold codes, IDs and numbers.

Techniques beyond edit distance

Edit distance is the backbone, but fuzzy search draws on several related methods. N-gram similarity compares the overlap of character sequences and works well for longer strings and for partial matches inside words. Phonetic algorithms such as Soundex and Metaphone encode words by how they sound, so “Smith” and “Smyth” or “Catherine” and “Kathryn” map to the same code, which is useful for name search. Jaro-Winkler similarity gives extra weight to matching prefixes and is popular for matching short strings such as names in record linkage.

Technique

What it measures

Good for

Weak spot

Levenshtein distance

Insertions, deletions, substitutions

General typo tolerance

Over-matches short words

Damerau-Levenshtein

Adds adjacent transpositions

Keyboard slips such as “teh”

Same as Levenshtein

Character n-grams

Shared substrings

Partial and in-word matches

Larger index

Phonetic codes

How words sound

Names and spoken input

Language-specific, coarse

Jaro-Winkler

Character agreement, prefix weight

Short strings, record linkage

Less suited to full-text ranking

These methods also appear well outside the search box. Deduplication and entity resolution use fuzzy matching to decide that “Acme Corp.” and “ACME Corporation” are the same company, and data normalization jobs use it to clean up free-text fields before analysis. Near-duplicate detection for documents and images is a related idea that compares whole items rather than single words.

Fuzzy search vs typo tolerance, stemming and semantic search

Typo tolerance is the product-level name for applying fuzzy matching to a search box. Hosted engines such as Algolia, Typesense and Meilisearch turn it on by default with rules about word length, the first letter and how many typos are allowed, so users get forgiving results without tuning fuzziness themselves. Fuzzy search is the broader technique underneath.

Stemming and lemmatization solve a different problem. They map correctly spelled variants such as “indexing” and “indexed” to a shared root, while fuzzy matching handles misspelled ones. A search system usually needs both: the stemmer collapses grammatical forms, and fuzzy matching catches the typos that remain.

Semantic search handles closeness in meaning rather than spelling. An embedding model places “reset 2FA” near “turn off two-step verification” even though the words share almost nothing, which no amount of edit distance would catch. Embeddings are also somewhat robust to typos, because subword tokenization breaks an unfamiliar misspelling into pieces the model has seen. They are less reliable on rare names, codes and jargon, where a misspelling can push the vector somewhere unhelpful. That is the main reason hybrid search pairs a vector retriever with a typo-tolerant keyword retriever and merges them with a method such as reciprocal rank fusion. The trade-offs are laid out in semantic search vs keyword search and hybrid search vs vector search.

Trade-offs and tuning

Fuzzy matching raises recall and lowers precision. Every extra allowed edit brings in more candidates, some of them wrong, and a large fuzziness setting on a big index can also slow queries noticeably. Precision and recall give a way to see the balance on real traffic. Most teams settle on a few rules that work across domains. Allow no edits on terms shorter than three or four characters. Require the first character, or the first two, to match exactly, since people rarely mistype the start of a word. Rank exact and prefix matches above fuzzy ones. Disable fuzziness on fields holding identifiers, email addresses and numbers.

Measure the effect with real queries. Pull misspelled queries from your logs, which are easy to spot because they return few or no results, and check whether fuzzy matching surfaces the intended document within the top results. Recall at k at your interface’s cut-off and a small golden dataset of labelled queries are usually enough. For agents and retrieval-augmented generation, the same check matters on the queries a model writes, which are usually spelled correctly but may use different terms from your documents. Query rewriting and query expansion handle that gap better than fuzziness does.

Fuzzy search for AI agents

Fuzzy matching matters in agent systems in two places. The first is any search box where people type queries directly into an assistant or copilot. Users misspell product names, people’s names and technical terms, and an agent that cannot find the document behind a misspelled query gives a weak answer or none. The second is in the data the agent searches: OCR output from scanned documents, transcripts of audio and video, and user-generated notes all contain their own errors. An invoice processed with OCR may read “lnvoice” for “Invoice”, and a meeting transcript may spell a colleague’s name three different ways. Typo-tolerant matching on the index side lets an exact query still reach those passages.

Fuzzy matching is also tied closely to autocomplete. Search-as-you-type interfaces combine prefix matching, which treats the last partial word as the start of a longer term, with fuzzy matching on the words already typed. That pairing lets “kubern dep” suggest “Kubernetes deployment” before the user has finished typing. Agents rarely need autocomplete themselves, but the products built on them often do, and the same index usually serves both the human search box and the agent’s retrieval calls. Keeping one index with sensible fuzzy rules is simpler than maintaining a separate path for each.

How Exabase handles typos

Exabase builds typo tolerance into search, so there is no fuzziness setting to tune. Deep Search runs every text query as a hybrid of semantic search and typo-tolerant keyword matching, which means misspelled queries still match the right terms while the semantic side catches paraphrases and different wording. When you need an exact match, for a product code, a name or an error message, wrap the phrase in double quotes and fuzzy matching is set aside for that phrase.

Content stored as Resources is indexed automatically at write time, including OCR text from images, transcripts of audio and video, and the content of bookmarked web pages, so typo-tolerant search covers more than just typed documents. The precision parameter, from 0 to 1, widens or narrows results per query, and filters narrow by tag, folder, type or date. The searching resources guide and the search API reference cover the request. Exabase provides the search layer; how results are presented to your users stays in your product. If you are comparing hosted engines, Exabase vs Algolia, Algolia vs Typesense and Exabase vs Meilisearch cover the differences, and the RAG accuracy solution explains how retrieval quality affects answers.

Frequently asked questions

What is fuzzy search in simple terms?

Fuzzy search finds results that are close to what you typed, not only exact matches. If you search for “accomodation”, it still finds “accommodation”, because the two words differ by a single letter.

How does fuzzy search work?

Most fuzzy search measures edit distance: the number of characters you would need to insert, delete, substitute or swap to turn the query word into an indexed word. Words within a set limit, usually one or two edits, count as matches and are ranked below exact matches.

What is Levenshtein distance?

Levenshtein distance is the minimum number of single-character insertions, deletions and substitutions needed to change one string into another. “Book” to “back” is two substitutions, so the distance is 2. It is the most widely used measure in fuzzy search.

What is the difference between fuzzy search and semantic search?

Fuzzy search matches words that are spelled similarly, while semantic search matches text that means something similar. Fuzzy search fixes typos; semantic search finds paraphrases. Hybrid search combines the two.

Is fuzzy search the same as typo tolerance?

They are closely related. Fuzzy search is the underlying technique; typo tolerance is how search products apply it by default, with rules about word length and which characters may change.

When should I turn fuzzy matching off?

Turn it off for fields holding identifiers, codes, SKUs, email addresses and numbers, where a near match is a wrong match. Keep it on for natural-language text such as titles, descriptions and body content.

Does Exabase support fuzzy search?

Yes. Deep Search combines typo-tolerant keyword matching with semantic search on every text query, with no configuration. Wrap a phrase in double quotes to force an exact match when a near match would be wrong.

Related pages: typo tolerance, stemming, lemmatization, keyword search, hybrid search, entity resolution, Typesense alternatives, hybrid search for SKUs, customer support agents, RAG accuracy

Cut your token spend and give your agent precise context.

Get started in minutes.

Cut your token spend and give your agent precise context.

Get started in minutes.