az search service list --resource-group <resource-group>Search document
A search document is a single searchable JSON record stored in an Azure AI Search index. It contains field values defined by the index schema, including a unique key, retrievable content, filters, facets, sortable values, and sometimes vector fields.
Source: Microsoft Learn - Search indexes in Azure AI Search Reviewed 2026-05-23
- Exam trap
- Using unstable generated keys that change on every load and create duplicate documents instead of updating existing records.
- Production check
- Retrieve a known document by key and compare every critical field with the source system.
Article details and learning context
- Aliases
- Azure AI Search document, search index document, indexed document, searchable document, document in search index
- Difficulty
- fundamentals
- CLI mappings
- 5
- Last verified
- 2026-05-23
- Review level
- premium
- Article depth
- field-manual-template-specs
Understand the concept
In plain English
A search document is one item inside an Azure AI Search index. If an index is like a table, a search document is roughly like a row. It might represent a product, hotel, support article, claim, image, or chunk of a larger file. The index schema decides which fields the document can contain and how those fields behave. Users do not search the original database directly; they search these indexed documents that have been shaped for fast retrieval.
Why it matters
Search documents matter because they are what users and applications actually retrieve. Poor document design can make a perfect service feel broken: huge documents bury answers, tiny documents lose context, missing fields prevent filters, and bad keys make updates unreliable. In AI retrieval scenarios, document shape also controls what grounding content reaches a model. Operators need to understand documents to troubleshoot freshness, relevance, authorization, and cost. The right document granularity turns search into a dependable product feature; the wrong granularity creates confusing results, expensive reindexing, and brittle application logic. It is the object people trust when search becomes a workflow.
Technical context
In Azure architecture, search documents live in the data plane of an Azure AI Search index. They are uploaded through push APIs or produced by indexers from external data sources. Each document has a key field and fields configured as searchable, filterable, sortable, facetable, retrievable, or vector-capable. Queries return matching documents with metadata such as scores, captions, highlights, or selected fields. Document design connects source data modeling, index schema, security trimming, vector chunking, and application response contracts.
Exam context
What to know
Explains the Azure AI Search concept in operational terms with security, reliability, cost, performance, CLI, and case-study context.
Compare with
Where it is used
Where you see it
- In REST or SDK indexing payloads, each JSON object contains the document key and field values being uploaded, merged, deleted, or retried during repair workflows.
- In Search Explorer results, returned documents show selected fields, @search.score, highlights, captions, vector-related metadata, and retrievable business identifiers returned to the application layer during support checks.
- In index statistics, document count and storage size reveal whether ingestion, chunking, deletes, or rebuilds changed the shape of searchable content after scheduled ingestion runs.
- In application logs, result document IDs and parent IDs help trace why a user saw a specific product, article, claim, or content chunk.
Common situations
- Choose document granularity for RAG so each retrieved chunk has enough context without flooding the model prompt.
- Design stable key fields that let ingestion pipelines merge, delete, and reload records without duplicate search results.
- Add filterable tenant, region, or security fields so applications can trim results before users see documents.
- Reduce query payload size by marking only necessary fields as retrievable and excluding oversized internal content.
- Troubleshoot stale or missing search results by comparing source records with uploaded documents and indexer errors.
Illustrative Azure scenarios
These examples show how the concept can affect design and operations. They are illustrative scenarios, not customer claims.
Scenario 01 Museum archive reshapes exhibits into searchable records Scenario, objectives, solution, measured impact, and takeaway.
A museum digitized exhibit notes, images, and audio transcripts, but visitors searched broad PDFs that returned huge, hard-to-read result snippets.
- Create search documents that matched visitor questions instead of archive file boundaries.
- Preserve exhibit, artist, year, and rights metadata on every result.
- Reduce oversized result payloads for the public website.
- Support future AI-guided tours with clean grounding content.
The digital team redesigned each search document around exhibit sections rather than whole PDFs. Every document carried a stable key, parent exhibit ID, artist metadata, rights status, language, and a concise retrievable text block. Image and audio transcript content were stored as related documents with the same parent ID. The ingestion pipeline used mergeOrUpload for updates and delete actions when exhibit sections were withdrawn. Azure CLI confirmed the search service endpoint, diagnostics, and admin-key handling before REST checks sampled documents by key. The website displayed section-level results and linked back to the full exhibit page.
- Average result payload size fell by 63 percent.
- Visitor clickthrough from search results to exhibit pages increased by 28 percent.
- Content-update errors dropped because stable keys allowed targeted merges instead of full reloads.
- The AI-tour prototype reused the same document chunks without a second ingestion pipeline.
Search document design decides whether users retrieve a useful answer-sized record or an overwhelming source file.
Scenario 02 Insurance claims team fixes duplicate adjuster results Scenario, objectives, solution, measured impact, and takeaway.
An insurance claims application showed duplicate claim notes after every nightly load because the search document key included a changing timestamp.
- Stop duplicate search results for adjusters reviewing active claims.
- Make nightly updates idempotent across claim notes and attachments.
- Keep claim-level security filters populated on every document.
- Reduce manual cleanup after failed ingestion runs.
The engineering team changed the search document model to use a stable composite key based on claim ID, note ID, and attachment sequence. Tenant ID, claim status, adjuster region, and confidentiality flags were added as filterable fields. The ingestion job switched from upload-only behavior to mergeOrUpload for changed notes and delete actions for removed attachments. Azure CLI verified the target search service and diagnostics, while REST sampled document keys before and after the next three nightly loads. Operators compared document counts by claim against the source system and created alerts for unexpected growth.
- Duplicate claim-note results fell from 18 percent of active-claim searches to under 1 percent.
- Nightly indexing cleanup work dropped from five hours to 30 minutes.
- Adjuster search p95 latency improved by 21 percent because fewer duplicate candidates were returned.
- Security-filter completeness reached 99.8 percent across sampled documents.
Stable search document keys are the difference between safe updates and a growing pile of duplicate indexed content.
Scenario 03 B2B commerce site trims product document payloads Scenario, objectives, solution, measured impact, and takeaway.
A B2B commerce site indexed every product attribute as retrievable, causing slow search responses and exposing internal supplier notes to authenticated buyers.
- Reduce search response payload size without hurting product discovery.
- Remove internal fields from buyer-visible search results.
- Keep filters for availability, contract price band, and region.
- Avoid scaling replicas solely to compensate for bloated responses.
The commerce team reviewed the product search document schema and separated searchable, filterable, sortable, and retrievable needs. Supplier notes, internal margin fields, and warehouse-only diagnostics stayed indexed only where necessary or were removed from the search document entirely. Buyer-facing fields kept concise descriptions, SKU, availability, region, price band, and image references. The ingestion pipeline validated required fields before upload and logged document size. Azure CLI confirmed the service SKU, replicas, diagnostics, and endpoint before REST statistics and sample document checks. The app team updated result templates to request only the fields needed for the search page.
- Median search payload size dropped from 42 KB to 11 KB per result page.
- Search p95 response time improved from 780 milliseconds to 410 milliseconds.
- Internal supplier-note exposure was removed from buyer-visible responses.
- The team postponed a replica increase, avoiding roughly $2,600 monthly in capacity cost.
Search documents should expose exactly the fields needed for retrieval, display, filters, and governance, not every source attribute.
Azure CLI
For search documents, Azure CLI helps me establish the environment and run controlled REST checks without relying on portal clicks. The document operations themselves are data-plane REST or SDK calls, but CLI still confirms the service, endpoint, keys, identity, diagnostics, and resource context. In production, document bugs usually come from the wrong index, stale ingestion job, missing key field, or unsafe secret handling. CLI lets an engineer script document counts, sample retrieval, and service evidence before blaming the application. It also creates repeatable commands for support teams investigating one missing or duplicated result. That repeatability matters when support is chasing one missing record.
Useful for
- Confirm the search service and endpoint before retrieving or uploading sample documents through REST.
- Get a temporary admin key from a secure runbook to inspect document counts or load a controlled test record.
- Use az rest to retrieve one document by key and verify field values, retrievable content, and tenant metadata.
- Check indexer status when documents are missing, stale, duplicated, or not reflecting source deletes.
- Export metrics and diagnostics to correlate document indexing failures with latency, throttling, or source-system errors.
Before you run a command
- Confirm tenant, subscription, resource group, search service, index name, document key, API version, and whether the request mutates production data.
- Use proper data-plane permission or a protected admin key; never expose document payloads or keys in shared command logs.
- Know the destructive risk: delete, merge, upload, and mergeOrUpload actions can change indexed content immediately.
- Estimate cost and load if commands trigger bulk uploads, reindexing, vector updates, or large document retrievals.
What the output tells you
- Document GET output confirms whether the key exists, which fields are retrievable, and whether metadata matches the source record.
- Index statistics show document count and storage size, helping identify missed deletes, over-chunking, duplicate loads, or incomplete indexing.
- Indexer status output explains failed document counts, parsing errors, mapping problems, and timestamps from the latest ingestion run.
- Query output reveals scores, highlights, captions, selected fields, and result ordering so teams can connect document shape to user experience.
Mapped commands
Azure AI Search operations
directaz search service show --name <search-service> --resource-group <resource-group>az search service create --name <search-service> --resource-group <resource-group> --sku basicaz search admin-key show --service-name <search-service> --resource-group <resource-group>az search service delete --name <search-service> --resource-group <resource-group>Architecture context
Architecturally, a search document is the retrieval unit of the index. I decide its shape after reviewing the user journey, source system, security boundary, update pattern, and ranking strategy. A product catalog might use one document per SKU, while a knowledge base for RAG might use one document per chunk with parent metadata. The key must be stable, fields must support the queries the app sends, and retrievable content should contain only what the user or model needs. Document design is where data architecture meets user experience, because every query result is ultimately a document payload. It should be settled before schema, chunking, and ranking are finalized.
- Security
- Security impact is direct because indexed documents may contain sensitive content copied from source systems. Azure AI Search does not automatically inherit every source-system permission model, so applications often enforce security trimming through filters, tenant IDs, user scopes, or separate indexes. Retrievable fields should exclude secrets, internal notes, and unnecessary personal data. Document keys and metadata should avoid leaking sensitive identifiers when possible. Private endpoints, role-based access, admin keys, and query keys protect the service boundary, but the document shape determines what could be exposed when an authorized query succeeds. Reviewers should inspect sample payloads, not only service-level access controls.
- Cost
- Search documents affect cost through index size, storage, indexing workload, replicas, partitions, semantic ranking usage, and source-system ingestion cost. More documents are not automatically better. Over-chunking a knowledge base can increase storage, query work, and AI prompt assembly, while under-chunking can hurt relevance and force repeated queries. Extra retrievable fields enlarge payloads and network transfer. FinOps reviews should connect document count, field design, vector dimensions, indexing frequency, and query volume. Smart document modeling often saves more than SKU tuning because it reduces unnecessary indexed material. The cheapest document is the one the application truly needs. Field reviews should challenge storage, vector, and retrieval assumptions.
- Reliability
- Reliability impact is direct for data correctness. A search service can be healthy while documents are stale, duplicated, partially loaded, or missing required fields. Stable keys allow safe updates and deletes; unstable keys create orphaned records and confusing results. Indexers and push pipelines need retry handling, idempotency, and validation so document changes reflect source truth. Recovery plans should include reloading affected documents, comparing counts with the source, and verifying deleted records disappear. Users judge reliability by whether search reflects reality, not by whether the index endpoint returns HTTP 200. Freshness checks should prove creates, updates, deletes, and retries all work.
- Performance
- Performance is strongly tied to document shape. Large documents, too many retrievable fields, oversized vectors, or poorly chosen filters can increase indexing time, query latency, and response payload size. Smaller, well-structured documents can improve recall and response speed, but excessive chunking creates more candidates to score and merge. Stable keys improve update performance because pipelines can merge or delete predictably. Measure indexing duration, document count, index size, p95 query latency, payload size, and top-result quality together. A document model that performs well in a demo may fail at production volume. Payload measurement should happen before teams buy more replicas. Operators should verify Search document evidence after the change.
- Operations
- Operators manage search documents by inspecting document counts, sampling records, validating key fields, checking indexing errors, and comparing index content with source systems. They troubleshoot missing results by looking at field attributes, filters, analyzer behavior, and whether the document was ever loaded. In RAG systems, they also inspect chunk size, parent IDs, citations, and retrievable text. Azure CLI helps confirm the service context and diagnostics, while REST or SDK calls upload, retrieve, merge, delete, or count documents. Good operations include test documents for every critical query pattern. Runbooks should include source comparison, key lookup, and sample query evidence. The evidence should be saved with each production release.
Common mistakes
- Using unstable generated keys that change on every load and create duplicate documents instead of updating existing records.
- Making every field retrievable, which exposes unnecessary content and increases response payload size.
- Treating a whole PDF as one document for RAG when smaller chunks with parent metadata would retrieve better context.
- Forgetting tenant or security fields, then trying to enforce access control after documents have already been returned.