A glowing cloud database searches and ranks code snippets using data, legal, and quality signals.
Azure DocumentDB, Microsoft's managed MongoDB-compatible database, now has a full-text search feature in public preview. The feature was announced in the November 17 Ignite roundup on the Azure DocumentDB blog. It lets developers run relevance-ranked keyword search over document data without standing up a separate search service. It is not generally available, and Azure Updates defines "in preview" as for non-production use and testing.

A glowing cloud database searches and ranks code snippets using data, legal, and quality signals. What Microsoft announced​

Microsoft describes Azure DocumentDB as a fully managed, MongoDB-compatible service built on the open-source DocumentDB project, which is governed by the Linux Foundation. The new feature adds BM25 relevance ranking, fuzzy matching, phrase and proximity search, and relevance scores. Developers create search indexes and query them with the MongoDB-compatible $search aggregation stage.

Microsoft pitches it for product discovery, knowledge-base retrieval and retrieval-augmented generation (RAG). Those are Microsoft's stated use cases, not benchmarked results. The announcement does not include performance figures.

The documentation history shows how recently this opened up. Earlier versions of the Learn overview described full-text search as being in Gated Preview. The fuzzy-search page then told users to email Microsoft to enable it on their cluster. The current overview instead gives self-service enablement steps, which matches the "public preview" label.

How it works​

Microsoft describes the feature as a BM25-scored, analyzer-driven keyword search engine exposed through MongoDB-compatible primitives. In practice, the documented capabilities are:

  • BM25 keyword search. $search with the text operator. BM25 weighs term frequency, how rare a term is across the collection, and document length. The score is monotonic: higher means more relevant within a single query. Microsoft cautions that scores are not directly comparable across different queries.
  • Fuzzy search. $search with text and fuzzy.maxEdits handles typo-tolerant matching. Matching uses a bounded Levenshtein edit distance, so a query for "bracXet" finds "bracket".
  • Phrase and proximity search. $search with phrase keeps term order. Its slop setting allows intervening tokens, with documented integer values from 0 to 10. A value of 0 requires adjacency. Larger values raise recall but can hurt precision. The phrase operator does not itself accept fuzzy matching.
  • Scores in results. Each returned document carries a BM25 score you can read with { $meta: "searchScore" }. Results come back in descending relevance order by default.
  • Hybrid retrieval. The overview describes separate keyword and cosmosSearch vector queries combined with reciprocal rank fusion (RRF). Both index types can live on the same cluster against the same collection. Microsoft's hybrid search page says full-text and vector search are included with the cluster at no extra cost.
  • Further options. The overview also lists custom analyzers, prefix search with edgeGram, pathHierarchy for hierarchical identifiers, and Chinese, Japanese, Korean and Thai analyzers. It adds multi-field search, structured conditions on token, number, date and Boolean fields via compound, and $search.sort on mapped scalar fields.

Enabling it​

Microsoft documents four routes: the Azure portal, Azure CLI, Terraform with the AzAPI provider, and Bicep.

In the portal:

  1. Open your Azure DocumentDB cluster.
  2. Under Settings, select Features.
  3. Select Full-text search, which starts with its status set to Off.
  4. Review the information in the pane that opens, then select Enable.

Wait 10 minutes. Microsoft says that after enabling the feature by any method, you should wait 10 minutes before creating an index or running a query. Seeing FullTextSearch in the resource configuration does not mean activation has finished.

Infrastructure-as-code caveat. The feature is set through the cluster's previewFeatures property. Microsoft's Bicep guidance says Bicep replaces the whole list with whatever you supply. It does not merge with existing preview features, so include every other preview feature you want to keep. The CLI example reads the current list and adds FullTextSearch once. For Terraform, if azurerm_mongo_cluster also manages the cluster, add preview_features to its lifecycle.ignore_changes. Check the plan, and stop if it proposes replacing the cluster.

Creating an index and querying​

Search indexes are a different object from ordinary document indexes, and this is the most likely stumbling block for MongoDB veterans.

  • Create the index with createSearchIndexes. Microsoft says explicitly that createIndex({ field: "text" }) is not the path for this engine.
  • Use static mappings. Set dynamic: false and list every searchable field under mappings.fields. Dynamic mappings are not supported. Index creation fails if dynamic is true, or if mappings.fields is missing or empty.
  • Check readiness with $listSearchIndexes. These indexes do not appear in getIndexes(). Index builds are asynchronous. Wait until the index shows status: "READY" and queryable: true before querying.
  • Put $search first in the pipeline and name the index. If you leave out index, the query targets an index called default. It does not pick an arbitrary index. Every query path must exist in the selected index.
  • Cap results with a downstream $limit. There is no count or limit field inside $search.
  • Place any downstream $match before the final $limit. That way the limit applies to eligible results rather than discarding matches early.

Typical failure points:

  • A "text" index created the old way, then wondering why $search ignores it.
  • Querying before the 10-minute activation window or before the index is queryable.
  • Referencing a field that was never mapped in the index.
  • Seeing an "Unrecognized $search option: text" error. A Microsoft Q&A user hit this before the feature was available on their cluster. If you see it, confirm the feature is enabled and that activation has finished.

What is not supported​

The documented gaps matter for planning:

  • Dynamic mappings, character filters, synonym definitions and storedSource.
  • compound.minimumShouldMatch and custom score boosts.
  • The autocomplete, queryString and near operators.
  • Regex and wildcard operators inside $search.
  • $searchMeta, $$SEARCH_META, counts, facets and highlighting.
  • The objectId, uuid, embeddedDocument, autocomplete and geo mapping types.
  • $rankFusion. Microsoft points to client-side or aggregation-pipeline RRF examples instead.

Facets, highlighting, counts and synonyms are staples of search-heavy applications such as e-commerce catalogs. A team coming from a dedicated search engine should check this list against its requirements before treating the feature as a drop-in replacement. That is my read of the list, not a Microsoft statement.

Relationship to existing $text and $regex​

Microsoft's migration table lists fuzzy search as "not available" in the legacy $text engine. It says $regex still works for substring patterns, but it is unranked. Microsoft says the overview's "when to use" table treats $regex as pattern matching without relevance ranking, with performance depending on the pattern and available indexes.

The existing $text operator and text indexes remain generally available. Enabling the preview does not change them. You can evaluate $search on a separate index without migrating anything.

Practical takeaways​

  • Good fit for evaluation. Dev and test environments, RAG prototypes and catalog-search proofs of concept, especially where you already use vector search on DocumentDB.
  • Not yet a production commitment. Preview status, the activation delay and the unsupported-feature list argue for testing with representative data and queries first.
  • Ecosystem support is appearing. Microsoft's DocumentDB MCP Toolkit says it runs both vector search and BM25 full-text search through its aggregate tool. A Haystack retriever for Azure DocumentDB full-text search also has documentation. Its docs say maxEdits accepts 1 or 2. The toolkit's own claims are Microsoft's, and I have not tested it.

The announcement is a vendor blog post, so treat the use-case claims as positioning. The documentation gives the concrete detail: setup steps, query shapes and limits. Whether the feature replaces a separate search service will depend on the workload, particularly on whether you rely on facets, highlighting or synonyms.

 

References

  1. (In preview) Public Preview: Full-text search in Azure DocumentDB Azure Updates 2026-11-17T20:00:32Z
  2. Full-Text Search Overview - Azure DocumentDB learn.microsoft.com
  3. BM25 Keyword Search - Ranked Text Retrieval - Azure DocumentDB learn.microsoft.com