Azure AI Search is a cloud-based search-as-a-service solution that allows you to integrate sophisticated search capabilities into your applications, including:
- Full-text search
- Semantic ranking
- Vector-based similarity
- Hybrid search (text + vector)
It supports unstructured and structured content from documents, databases, websites, and more.
π‘ Two Phases of Working with Azure AI Search
There are two key phases when working with Azure AI Search:
1. Ingestion (Define & Populate Indexes)
This phase involves both defining the structure of the index and populating it with data.
π§ Index Definition
Before you can search anything, you must define how your data will be stored and retrieved:
- Define index fields (types, attributes like searchable, filterable, sortable, facetable, etc.)
- Configure analyzers for full-text search
- Add semantic configuration for semantic search capabilities
- Add vector configuration for vector search (e.g., field dimensions, vector profiles)
- Enable scoring profiles, synonyms, and suggesters as needed
This step defines the βsearch contractβ β how your data can be queried later.
π₯ Index Population
Once the schema is defined, you populate the index with documents:
- Push: Upload data using REST API or SDK
- Pull: Use indexers (e.g., Azure Blob, SQL DB, ADLS Gen2)
- Supports batch or incremental updates
2. Retrieval (Search & Rank Results)
In this phase, you query the indexed data:
- Send search requests (keyword, semantic, vector, or hybrid)
- Use filters, scoring, semantic captions, and highlights
- Receive structured search results
β Why REST API Instead of SDK?
While Azure provides an official Python SDK (azure-search-documents
), it:
- Wraps the REST API, offering limited abstraction
- Lags behind the REST API in supporting newer features (e.g., hybrid search and latest vector capabilities)
- Lacks clear documentation for advanced use cases
π References and Further Reading
This section consolidates the key documentation used to build this project and serves as a study guide.
π Querying & Retrieval
Search Documents (REST API:
POST /search
)
https://learn.microsoft.com/en-us/rest/api/searchservice/documents/search-post?view=rest-searchservice-2024-07-01&tabs=HTTPSearch Result Pagination and Layout
https://learn.microsoft.com/pt-br/azure/search/search-pagination-page-layout
π¦ Index Management & Structure
Create an Index (Core Guide)
https://learn.microsoft.com/en-us/azure/search/search-how-to-create-search-index?tabs=portalAdd Vector Fields & Vector Profiles
https://learn.microsoft.com/en-us/azure/search/vector-search-how-to-create-indexAdd Semantic Ranking
https://learn.microsoft.com/en-us/azure/search/semantic-how-to-configure
π Security in Azure AI Search
Security Trimming
https://docs.azure.cn/en-us/search/search-security-trimming-for-azure-searchIndex ACLs & RBAC via REST API
https://learn.microsoft.com/en-us/azure/search/search-index-access-control-lists-and-rbac-push-apiQuery-Time ACL/RBAC Enforcement
https://learn.microsoft.com/en-us/azure/search/search-query-access-control-rbac-enforcementADLS Gen2 Indexer for Permission Metadata
https://learn.microsoft.com/en-us/azure/search/search-indexer-access-control-lists-and-role-based-access
π Index Ingestion & Updates
Data Import Overview
https://learn.microsoft.com/en-us/azure/search/search-what-is-data-importLoad Documents into an Index
https://learn.microsoft.com/en-us/azure/search/search-how-to-load-search-indexUpdate or Rebuild an Index
https://learn.microsoft.com/en-us/azure/search/search-howto-reindexChange and delete detection using indexers
https://learn.microsoft.com/en-us/azure/search/search-howto-index-changed-deleted-blobs?tabs=portal
Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.