Azure AI Search Exhaustive KNN: Audit Archive Retrieval Without Calling a Slower Query More Accurate

A missed archive result needs a controlled diagnosis

A collection search may fail to surface a repair guide even though its approved caption is indexed and semantically similar to the question. Azure AI Search supports HNSW approximate nearest-neighbor retrieval and exhaustive K-nearest-neighbor evaluation. The latter computes nearest neighbors by scanning the vector space instead of using the approximate graph traversal. It can help establish a retrieval reference for a controlled test. It does not prove that the index contains every original archive document or that the nearest result answers the visitor correctly. Begin with a known set of relevant source records, verified by a curator, and define the same query and permissions for each comparison.

Understand exhaustive as a query option

Microsoft documents the optional vectorQueries.exhaustive property on supported query APIs. Setting it to true invokes exhaustive KNN at query time, including when the underlying field is indexed for HNSW, where supported. Confirm the API version and SDK representation used by the deployed service; sample code for one version may not map directly to an older client library. Record the requested vector field, embedding model and version, k, query vector, and any filter settings. The parameter controls neighbor search behavior, not the embedding quality or semantic correctness of the archive labels. An exact similarity ranking is still a ranking over whatever data and vectors the service has.

Keep HNSW as the production baseline when appropriate

HNSW is designed to retrieve approximate neighbors efficiently at scale. A museum that receives many kiosk queries may value that behavior, provided tests show adequate recall for its approved content. Do not switch every query to exhaustive mode because one benchmark example improved. Define a set of queries that includes unusual object names, misspelled part identifiers, conceptually similar repairs, and terms with several meanings. Compare HNSW results with exhaustive KNN on the same indexed corpus. Then inspect the source labels, document dates, and visitor-facing explanation. A closer vector alone is not a sufficient reason to show a sensitive or outdated instruction.

Three-step conceptual process diagram: Freeze query and filters; Compare neighbor sets; Review source relevance.

Use equal settings for a fair comparison

A meaningful test fixes the embedding vectors, vector field, k, access filters, query text, and index snapshot. Only change the retrieval method being evaluated. If one request uses a different index, a broader rights filter, or a larger k, it is not an isolated test of approximate versus exhaustive search. Record candidate IDs, ranking order, and actual service timings rather than reporting fabricated speed or recall percentages. Where privacy rules exclude part of the archive, both queries must respect the same authorization boundary. The completeness of a reviewer-approved test set should be documented separately from the search service’s computed similarity scores.

Build a small ground-truth set with editorial input

Ask a curator or maintenance lead to mark which repair guides genuinely answer each test question and which are obsolete, restricted, or only superficially related. Store the judgments with source IDs and revision dates. A query about a solvent may retrieve both a historical usage note and a current safety instruction; the technically nearest result might not be the right public guidance. Use exhaustive results as one diagnostic reference, not as the sole truth label. When a result surprises the team, examine the source text and embedding choice before assuming the approximate algorithm is at fault.

Diagnose missing results in the right order

When HNSW misses an expected record, first establish that the document is indexed, has a vector in the targeted field, and satisfies the request filters. Check that the chosen embedding model and preprocessing match the indexed vectors. Then compare exact and approximate neighbors. A result absent from both lists may indicate indexing, filtering, or embedding problems rather than HNSW recall. A result present only in exhaustive output is a concrete lead for tuning the ANN configuration and rerunning representative tests. Avoid drawing diagrams in which exhaustive mode automatically repairs a malformed document or grants access to a restricted collection.

Three distinct illustrative workflow states: Approximate neighbors; Exact neighbors; Access review pending. Not measured outcomes.

Measure latency and resource tradeoffs from real runs

Exhaustive search scans many candidate vectors and may have different latency characteristics from approximate search. Microsoft documents both algorithms, but a universal speed multiplier is not defensible across varying service capacity, data volume, dimensionality, and filtering. Record request timestamps, response status, real elapsed times, k, index size, and model configuration in a staging environment. Measure enough repeated runs to detect obvious variance instead of selecting one striking anecdote. The goal is to understand whether the additional exact-neighbor search is affordable as a diagnostic or evaluation path, not to invent performance guarantees for a public article.

Keep filtering and access checks independent

Search relevance and document authorization solve different problems. A restricted artifact should remain hidden from public visitors even if its embedding ranks first under exhaustive KNN. Apply approved access controls in the application and supported query filters, then test that the results do not reveal restricted titles or descriptions. A filter can also make a candidate disappear intentionally, so the audit should document which eligibility rules were active. Compare a known public record and a deliberately restricted synthetic case. Do not label an authorized exclusion as a missing retrieval hit, and do not imply that a high similarity score overrides institutional disclosure rules.

Present comparison diagrams without fabricated numbers

A useful illustration shows a fixed query entering two retrieval paths, approximate HNSW candidates and exhaustive candidates, then a separate editorial relevance check. Show distinct example IDs or candidate shapes, explicitly framed as conceptual rather than measured output. Do not add synthetic precision percentages, milliseconds, or claims that a particular model was tested unless those figures come from real logged experiments. The differences in candidate sets are the point of the comparison, but the last step must be source validation. Otherwise the graphic teaches readers to confuse mathematical nearest neighbors with correct conservation instructions.

Visual audit points for AZURE EXHAUSTIVE KNN: Same vector and k?; Restrictions applied?; Ground truth reviewed?.

Turn findings into an approved tuning plan

If the controlled evaluation shows a real relevance gap, decide whether to revise indexed text, embeddings, filters, HNSW parameters, or the query strategy. Record the before and after corpus version and retain a rollback plan. Re-run a standard set of public and restricted scenarios after changes. In production, monitor documented retrieval failures and ask reviewers to verify difficult search cases rather than declaring a recall win solely from a higher score. The acceptable outcome is a reproducible improvement to authorized visitor search, not simply a setting toggled to true. Use the latest Microsoft guidance to check feature and API support before rollout.

How We Research

We reviewed the named official developer references Microsoft Learn: Vector relevance and ranking, Microsoft Learn: Create a vector query. We compared their documented request and delivery behavior, accepted configuration patterns, and explicit limitations with the proposed hypothetical museum workflow. This article is a source-based implementation guide: we did not execute live customer API calls, inspect private cloud accounts, run production tests, or measure latency, cost, or accuracy. Readers should verify current limits and deployment settings with the original documentation and run their own controlled staging tests before changing public systems.

Frequently Asked Questions

Is exhaustive KNN available as a query-time option?

Yes. Supported vectorQueries requests include an optional exhaustive flag, including over HNSW-indexed fields.

Does exhaustive search mean every archive record is indexed?

No. It searches the vectors that are present and eligible for the query, not missing source documents.

Will exhaustive always give better visitor answers?

No. Exact nearest vectors can still correspond to irrelevant or outdated source content.

Should production queries always set exhaustive to true?

Not automatically. Compare observed latency and relevance on representative staging cases first.

Can exhaustive KNN override restrictions on private records?

No. Permissions and approved filters remain separate requirements from vector ranking.

Scroll to Top