---
title: Fuzzy Search with Azure AI Search
canonical: "https://data-driven.com/blog/fuzzy-search-using-azure-cognitive-search/"
pubDate: "2021-11-04T00:00:00.000Z"
updatedDate: "2026-08-25T00:00:00.000Z"
description: A versioned tutorial for indexing text and testing typo-tolerant queries through the current Azure AI Search REST API.
tags: [azure, learning]
categories: [azure]
---

Fuzzy search can return text terms that are close to a user's input. It is useful for simple misspellings, but it can also widen results and add query cost. Test it against real queries instead of treating it as automatic correction.

Microsoft's <a href="https://learn.microsoft.com/en-us/azure/search/search-query-fuzzy" target="_blank" rel="noopener noreferrer">current fuzzy-search documentation</a> defines the supported syntax and limits. This updated tutorial replaces the original 2021 portal sequence, which used a preview API and public blob access.

## Prepare a searchable index

Create or reuse an Azure AI Search index with the text fields you want to query marked as searchable. Load a small, representative data set through an approved source connection or push API.

Keep the source private. Choose managed identity, keys, network controls, and indexer permissions against your organisation's security requirements. The search tutorial does not require anonymous blob access.

![Original 2021 diagram showing a search service between a data source and client](../../assets/blog/2021/11/image1-1.png)

The diagram remains useful as a high-level data flow. Portal labels and setup screens have changed since it was captured.

## Send a full Lucene fuzzy query

Set `queryType` to `full` and add `~` after each whole term that should allow a fuzzy match. This example uses the stable `2026-04-01` REST API documented by Microsoft at the time of this update:

```json
POST https://{service-name}.search.windows.net/indexes/{index-name}/docs/search?api-version=2026-04-01
{
  "search": "seatle~ waterfront~ view~ hotle~",
  "queryType": "full",
  "searchMode": "any",
  "searchFields": "HotelName,Description",
  "select": "HotelName,Description,Address/City",
  "count": true
}
```

Microsoft lists `2026-04-01` as the current stable version in the <a href="https://learn.microsoft.com/en-us/rest/api/searchservice/search-service-api-versions" target="_blank" rel="noopener noreferrer">Azure AI Search API version table</a>. Pin an API version and review that table before upgrading.

## Control edit distance and scope

The default fuzzy edit distance is two. Use `~1` to allow one insertion, deletion, substitution, or adjacent-character transposition. Use `~0` for an exact term.

Scope `searchFields` to fields where typo tolerance is useful. A broad fuzzy query can generate up to 50 expansions per term, introduce unexpected lexical matches, and respond more slowly than a simpler query.

## Evaluate the result, not just the response code

Build a test set with correct spellings, common mistakes, short terms, names, and queries that must not match. Record:

- whether the intended document appears;
- which term produced the match;
- irrelevant results introduced by expansion;
- response time at representative scale;
- differences by language and analyzer.

Use Search Explorer or a REST client for iteration. Hit highlighting can help identify a fuzzy match, but Microsoft notes that it has limitations when queries use scoring profiles or more complex syntax.

If fuzzy expansion is too broad or slow, test language analyzers, synonym maps, or n-gram indexing. Each alternative changes storage, maintenance, and relevance behaviour, so compare them against the same test set.
