Build Azure Search Applications
.NET skill for Azure AI Search - full-text, vector, semantic, and hybrid search with type-safe index definitions.
Why it matters
Leverage Azure Cognitive Search to build powerful search applications with full-text, vector, semantic, and hybrid search capabilities using .NET.
Outcomes
What it gets done
Integrate Azure.Search.Documents SDK for .NET
Configure and manage search indexes, documents, and data sources
Implement advanced search patterns including vector, semantic, and hybrid search
Utilize FieldBuilder for efficient index schema definition
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-azure-search-documents-dotnet | bash Overview
Azure.Search.Documents (.NET)
.NET skill for Azure AI Search, covering type-safe index definitions via FieldBuilder attributes, document CRUD/batch operations, and full-text, faceted, vector, semantic, and hybrid search query patterns. Use when building search functionality - full-text, vector, semantic, or hybrid - in a .NET application on Azure AI Search.
What it does
This skill builds search applications with full-text, vector, semantic, and hybrid search using Azure.Search.Documents (.NET, stable v11.7.0), authenticated via DefaultAzureCredential (preferred) or an AzureKeyCredential API key. It distinguishes three client types: SearchClient for querying indexes and uploading/updating/deleting documents, SearchIndexClient for creating and managing indexes and synonym maps, and SearchIndexerClient for managing indexers, skillsets, and data sources. Index creation is shown two ways: the recommended FieldBuilder approach, decorating a POCO's properties with [SimpleField] (filterable/sortable/facetable, non-searchable), [SearchableField] (full-text searchable, with an optional analyzer like LexicalAnalyzerName.EnLucene), and [VectorSearchField] (a ReadOnlyMemory<float> embedding field with a declared dimension count and vector-search profile) - or manual field definition building the same SearchField objects directly, both requiring a VectorSearch configuration with a named profile and an HNSW algorithm. Document operations cover UploadDocumentsAsync (add new), MergeDocumentsAsync (update existing), MergeOrUploadDocumentsAsync (upsert), DeleteDocumentsAsync by key, and batched mixed operations via IndexDocumentsBatch/IndexDocumentsAction. Search patterns cover basic filtered/sorted/paged/projected search with SearchOptions (Filter, OrderBy, Select, Size, Skip, IncludeTotalCount), faceted search (aggregating result counts per field value), autocomplete and fuzzy-matched suggestions via a named suggester, pure vector search (a VectorizedQuery with a k-nearest-neighbors count against a named vector field), semantic search (a named semantic configuration producing extractive captions and answers alongside ranked results), and hybrid search combining vector, keyword, and semantic ranking in a single query for the best relevance - with detailed vector-search and semantic-search patterns deferred to companion reference files. A field-attribute reference table covers SimpleField/SearchableField/VectorSearchField and modifiers (IsKey, IsFilterable, IsSortable, IsFacetable, IsHidden, AnalyzerName). Error handling distinguishes a 404 (index not found) via RequestFailedException. Best practices: prefer DefaultAzureCredential over API keys in production, use FieldBuilder with model attributes for type-safe index definitions, use CreateOrUpdateIndexAsync for idempotent index creation, batch document operations for throughput, project only needed fields with Select, configure semantic search for natural-language queries, and combine vector, keyword, and semantic search for the best relevance.
When to use - and when NOT to
Use this skill when building search functionality in a .NET application on Azure AI Search - full-text search with filters/facets, vector/embedding-based semantic similarity search, natural-language semantic ranking, or a hybrid combination of all three for best relevance. It is not an indexer/skillset orchestration deep-dive (that's SearchIndexerClient's domain, only named here) and detailed vector/semantic search implementation patterns live in companion reference files rather than fully inline in this overview. Connection details are read from SEARCH_ENDPOINT, SEARCH_INDEX_NAME, and, for API-key auth, SEARCH_API_KEY.
Inputs and outputs
Input is documents to index (typed POCOs or raw field data) and search queries (keyword text, filters, vector embeddings, or a combination). Output is ranked search results with scores, optional facet counts, autocomplete/suggestion candidates, and for semantic search, extractive answers and captions.
Integrations
Built on Azure AI Search via Azure.Search.Documents, authenticated with Azure Identity's DefaultAzureCredential or an API key, with SearchIndexerClient for indexer/skillset/data-source orchestration.
dotnet add package Azure.Search.Documents
Who it's for
.NET developers building search experiences - full-text, vector/embedding, semantic, or hybrid - on Azure AI Search who need type-safe index definitions and production-ready query patterns.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.