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-ts.md
1# Azure AI Search — TypeScript SDK Quick Reference23> Condensed from **azure-search-documents-ts**. Full patterns (semantic config, vector profiles, autocomplete)4> in the **azure-search-documents-ts** plugin skill if installed.56## Install7```bash8npm install @azure/search-documents @azure/identity9```1011## Quick Start12```typescript13import { SearchClient, SearchIndexClient, SearchIndexerClient } from "@azure/search-documents";14const searchClient = new SearchClient(endpoint, indexName, credential);15```1617## Non-Obvious Patterns18- Vector search uses `vectorSearchOptions.queries` array with `kind: "vector"`19- Semantic search requires `queryType: "semantic"` + `semanticSearchOptions`20- Batch ops: `searchClient.indexDocuments({ actions: [{ upload: doc }, { delete: doc }] })`2122## Best Practices231. Use hybrid search — combine vector + text for best results242. Enable semantic ranking — improves relevance for natural language queries253. Batch document uploads — use `uploadDocuments` with arrays, not single docs264. Use filters for security — implement document-level security with filters275. Index incrementally — use `mergeOrUploadDocuments` for updates286. Monitor query performance — use `includeTotalCount: true` sparingly in production29