Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build with Azure AI Search, Speech, OpenAI, and Document Intelligence services.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/sdk/azure-search-documents-py.md
1# Azure AI Search — Python SDK Quick Reference23> Condensed from **azure-search-documents-py**. Full patterns (agentic retrieval, integrated vectorization, skillsets)4> in the **azure-search-documents-py** plugin skill if installed.56## Install7```bash8pip install azure-search-documents azure-identity9```1011## Quick Start12```python13from azure.search.documents import SearchClient14from azure.search.documents.indexes import SearchIndexClient, SearchIndexerClient15from azure.search.documents.models import VectorizedQuery16```1718## Non-Obvious Patterns19- `SearchIndexingBufferedSender` for batch uploads with auto-batching/retries20- Vector field type: `Collection(Edm.Single)` with `vector_search_dimensions` + `vector_search_profile_name`21- Async client: `from azure.search.documents.aio import SearchClient`22- `KnowledgeBaseRetrievalClient` for agentic retrieval with LLM-powered Q&A2324## Best Practices251. Use hybrid search for best relevance combining vector and keyword262. Enable semantic ranking for natural language queries273. Index in batches of 100-1000 documents for efficiency284. Use filters to narrow results before ranking295. Configure vector dimensions to match your embedding model306. Use HNSW algorithm for large-scale vector search317. Create suggesters at index creation time (cannot add later)328. Use `SearchIndexingBufferedSender` for batch uploads339. Always define semantic configuration for agentic retrieval indexes3410. Use `create_or_update_index` for idempotent index creation3511. Close clients with context managers or explicit `close()`36