[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6XETKZWMKAMHDXGDD8SXC1E":3,"skill-same:01M6XETKZWMKAMHDXGDD8SXC1E":65},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":45,"commitSha":46,"skillDirectory":47,"forksCount":14,"repositoryHtmlUrl":48,"repositoryHomepageUrl":6,"ownerHtmlUrl":49,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":50,"install":51,"resources":64},"01M6XETKZWMKAMHDXGDD8SXC1E","azure-search-documents-py",null,"Azure AI Search SDK for Python. Use for vector search, hybrid search, semantic ranking, indexing, and skillsets.","sapsapshen\u002Fai-memory-router","sapsapshen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F20347959?v=4","01M6XDQEF1DP50DKF37H81J3J5","shenmian","01M6XDQEJPE41Y3DT2763X8ZJN",0,"MIT","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fazure-search-documents-py\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"documents","azure","azure search documents py","search","search documents","use","2026","hybrid","unknown","for","Hybrid Search","ranking","semantic","indexing","community","python","Vector Search","vector","azure ai","sdk","2026-11-10 10:12:30",false,"---\nname: azure-search-documents-py\ndescription: Azure AI Search SDK for Python. Use for vector search, hybrid search, semantic ranking, indexing, and skillsets.\nrisk: unknown\nsource: community\ndate_added: '2026-02-27'\n---\n\n# Azure AI Search SDK for Python\n\nFull-text, vector, and hybrid search with AI enrichment capabilities.\n\n## Installation\n\n```bash\npip install azure-search-documents\n```\n\n## Environment Variables\n\n```bash\nAZURE_SEARCH_ENDPOINT=https:\u002F\u002F\u003Cservice-name>.search.windows.net\nAZURE_SEARCH_API_KEY=\u003Cyour-api-key>\nAZURE_SEARCH_INDEX_NAME=\u003Cyour-index-name>\n```\n\n## Authentication\n\n### API Key\n\n```python\nfrom azure.search.documents import SearchClient\nfrom azure.core.credentials import AzureKeyCredential\n\nclient = SearchClient(\n    endpoint=os.environ[\"AZURE_SEARCH_ENDPOINT\"],\n    index_name=os.environ[\"AZURE_SEARCH_INDEX_NAME\"],\n    credential=AzureKeyCredential(os.environ[\"AZURE_SEARCH_API_KEY\"])\n)\n```\n\n### Entra ID (Recommended)\n\n```python\nfrom azure.search.documents import SearchClient\nfrom azure.identity import DefaultAzureCredential\n\nclient = SearchClient(\n    endpoint=os.environ[\"AZURE_SEARCH_ENDPOINT\"],\n    index_name=os.environ[\"AZURE_SEARCH_INDEX_NAME\"],\n    credential=DefaultAzureCredential()\n)\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `SearchClient` | Search and document operations |\n| `SearchIndexClient` | Index management, synonym maps |\n| `SearchIndexerClient` | Indexers, data sources, skillsets |\n\n## Create Index with Vector Field\n\n```python\nfrom azure.search.documents.indexes import SearchIndexClient\nfrom azure.search.documents.indexes.models import (\n    SearchIndex,\n    SearchField,\n    SearchFieldDataType,\n    VectorSearch,\n    HnswAlgorithmConfiguration,\n    VectorSearchProfile,\n    SearchableField,\n    SimpleField\n)\n\nindex_client = SearchIndexClient(endpoint, AzureKeyCredential(key))\n\nfields = [\n    SimpleField(name=\"id\", type=SearchFieldDataType.String, key=True),\n    SearchableField(name=\"title\", type=SearchFieldDataType.String),\n    SearchableField(name=\"content\", type=SearchFieldDataType.String),\n    SearchField(\n        name=\"content_vector\",\n        type=SearchFieldDataType.Collection(SearchFieldDataType.Single),\n        searchable=True,\n        vector_search_dimensions=1536,\n        vector_search_profile_name=\"my-vector-profile\"\n    )\n]\n\nvector_search = VectorSearch(\n    algorithms=[\n        HnswAlgorithmConfiguration(name=\"my-hnsw\")\n    ],\n    profiles=[\n        VectorSearchProfile(\n            name=\"my-vector-profile\",\n            algorithm_configuration_name=\"my-hnsw\"\n        )\n    ]\n)\n\nindex = SearchIndex(\n    name=\"my-index\",\n    fields=fields,\n    vector_search=vector_search\n)\n\nindex_client.create_or_update_index(index)\n```\n\n## Upload Documents\n\n```python\nfrom azure.search.documents import SearchClient\n\nclient = SearchClient(endpoint, \"my-index\", AzureKeyCredential(key))\n\ndocuments = [\n    {\n        \"id\": \"1\",\n        \"title\": \"Azure AI Search\",\n        \"content\": \"Full-text and vector search service\",\n        \"content_vector\": [0.1, 0.2, ...]  # 1536 dimensions\n    }\n]\n\nresult = client.upload_documents(documents)\nprint(f\"Uploaded {len(result)} documents\")\n```\n\n## Keyword Search\n\n```python\nresults = client.search(\n    search_text=\"azure search\",\n    select=[\"id\", \"title\", \"content\"],\n    top=10\n)\n\nfor result in results:\n    print(f\"{result['title']}: {result['@search.score']}\")\n```\n\n## Vector Search\n\n```python\nfrom azure.search.documents.models import VectorizedQuery\n\n# Your query embedding (1536 dimensions)\nquery_vector = get_embedding(\"semantic search capabilities\")\n\nvector_query = VectorizedQuery(\n    vector=query_vector,\n    k_nearest_neighbors=10,\n    fields=\"content_vector\"\n)\n\nresults = client.search(\n    vector_queries=[vector_query],\n    select=[\"id\", \"title\", \"content\"]\n)\n\nfor result in results:\n    print(f\"{result['title']}: {result['@search.score']}\")\n```\n\n## Hybrid Search (Vector + Keyword)\n\n```python\nfrom azure.search.documents.models import VectorizedQuery\n\nvector_query = VectorizedQuery(\n    vector=query_vector,\n    k_nearest_neighbors=10,\n    fields=\"content_vector\"\n)\n\nresults = client.search(\n    search_text=\"azure search\",\n    vector_queries=[vector_query],\n    select=[\"id\", \"title\", \"content\"],\n    top=10\n)\n```\n\n## Semantic Ranking\n\n```python\nfrom azure.search.documents.models import QueryType\n\nresults = client.search(\n    search_text=\"what is azure search\",\n    query_type=QueryType.SEMANTIC,\n    semantic_configuration_name=\"my-semantic-config\",\n    select=[\"id\", \"title\", \"content\"],\n    top=10\n)\n\nfor result in results:\n    print(f\"{result['title']}\")\n    if result.get(\"@search.captions\"):\n        print(f\"  Caption: {result['@search.captions'][0].text}\")\n```\n\n## Filters\n\n```python\nresults = client.search(\n    search_text=\"*\",\n    filter=\"category eq 'Technology' and rating gt 4\",\n    order_by=[\"rating desc\"],\n    select=[\"id\", \"title\", \"category\", \"rating\"]\n)\n```\n\n## Facets\n\n```python\nresults = client.search(\n    search_text=\"*\",\n    facets=[\"category,count:10\", \"rating\"],\n    top=0  # Only get facets, no documents\n)\n\nfor facet_name, facet_values in results.get_facets().items():\n    print(f\"{facet_name}:\")\n    for facet in facet_values:\n        print(f\"  {facet['value']}: {facet['count']}\")\n```\n\n## Autocomplete & Suggest\n\n```python\n# Autocomplete\nresults = client.autocomplete(\n    search_text=\"sea\",\n    suggester_name=\"my-suggester\",\n    mode=\"twoTerms\"\n)\n\n# Suggest\nresults = client.suggest(\n    search_text=\"sea\",\n    suggester_name=\"my-suggester\",\n    select=[\"title\"]\n)\n```\n\n## Indexer with Skillset\n\n```python\nfrom azure.search.documents.indexes import SearchIndexerClient\nfrom azure.search.documents.indexes.models import (\n    SearchIndexer,\n    SearchIndexerDataSourceConnection,\n    SearchIndexerSkillset,\n    EntityRecognitionSkill,\n    InputFieldMappingEntry,\n    OutputFieldMappingEntry\n)\n\nindexer_client = SearchIndexerClient(endpoint, AzureKeyCredential(key))\n\n# Create data source\ndata_source = SearchIndexerDataSourceConnection(\n    name=\"my-datasource\",\n    type=\"azureblob\",\n    connection_string=connection_string,\n    container={\"name\": \"documents\"}\n)\nindexer_client.create_or_update_data_source_connection(data_source)\n\n# Create skillset\nskillset = SearchIndexerSkillset(\n    name=\"my-skillset\",\n    skills=[\n        EntityRecognitionSkill(\n            inputs=[InputFieldMappingEntry(name=\"text\", source=\"\u002Fdocument\u002Fcontent\")],\n            outputs=[OutputFieldMappingEntry(name=\"organizations\", target_name=\"organizations\")]\n        )\n    ]\n)\nindexer_client.create_or_update_skillset(skillset)\n\n# Create indexer\nindexer = SearchIndexer(\n    name=\"my-indexer\",\n    data_source_name=\"my-datasource\",\n    target_index_name=\"my-index\",\n    skillset_name=\"my-skillset\"\n)\nindexer_client.create_or_update_indexer(indexer)\n```\n\n## Best Practices\n\n1. **Use hybrid search** for best relevance combining vector and keyword\n2. **Enable semantic ranking** for natural language queries\n3. **Index in batches** of 100-1000 documents for efficiency\n4. **Use filters** to narrow results before ranking\n5. **Configure vector dimensions** to match your embedding model\n6. **Use HNSW algorithm** for large-scale vector search\n7. **Create suggesters** at index creation time (cannot add later)\n\n## Reference Files\n\n| File | Contents |\n|------|----------|\n| references\u002Fvector-search.md | HNSW configuration, integrated vectorization, multi-vector queries |\n| references\u002Fsemantic-ranking.md | Semantic configuration, captions, answers, hybrid patterns |\n| scripts\u002Fsetup_vector_index.py | CLI script to create vector-enabled search index |\n\n\n---\n\n## Additional Azure AI Search Patterns\n\n# Azure AI Search Python SDK\n\nWrite clean, idiomatic Python code for Azure AI Search using `azure-search-documents`.\n\n## Installation\n\n```bash\npip install azure-search-documents azure-identity\n```\n\n## Environment Variables\n\n```bash\nAZURE_SEARCH_ENDPOINT=https:\u002F\u002F\u003Csearch-service>.search.windows.net\nAZURE_SEARCH_INDEX_NAME=\u003Cindex-name>\n# For API key auth (not recommended for production)\nAZURE_SEARCH_API_KEY=\u003Capi-key>\n```\n\n## Authentication\n\n**DefaultAzureCredential (preferred)**:\n```python\nfrom azure.identity import DefaultAzureCredential\nfrom azure.search.documents import SearchClient\n\ncredential = DefaultAzureCredential()\nclient = SearchClient(endpoint, index_name, credential)\n```\n\n**API Key**:\n```python\nfrom azure.core.credentials import AzureKeyCredential\nfrom azure.search.documents import SearchClient\n\nclient = SearchClient(endpoint, index_name, AzureKeyCredential(api_key))\n```\n\n## Client Selection\n\n| Client | Purpose |\n|--------|---------|\n| `SearchClient` | Query indexes, upload\u002Fupdate\u002Fdelete documents |\n| `SearchIndexClient` | Create\u002Fmanage indexes, knowledge sources, knowledge bases |\n| `SearchIndexerClient` | Manage indexers, skillsets, data sources |\n| `KnowledgeBaseRetrievalClient` | Agentic retrieval with LLM-powered Q&A |\n\n## Index Creation Pattern\n\n```python\nfrom azure.search.documents.indexes import SearchIndexClient\nfrom azure.search.documents.indexes.models import (\n    SearchIndex, SearchField, VectorSearch, VectorSearchProfile,\n    HnswAlgorithmConfiguration, AzureOpenAIVectorizer,\n    AzureOpenAIVectorizerParameters, SemanticSearch,\n    SemanticConfiguration, SemanticPrioritizedFields, SemanticField\n)\n\nindex = SearchIndex(\n    name=index_name,\n    fields=[\n        SearchField(name=\"id\", type=\"Edm.String\", key=True),\n        SearchField(name=\"content\", type=\"Edm.String\", searchable=True),\n        SearchField(name=\"embedding\", type=\"Collection(Edm.Single)\",\n                   vector_search_dimensions=3072,\n                   vector_search_profile_name=\"vector-profile\"),\n    ],\n    vector_search=VectorSearch(\n        profiles=[VectorSearchProfile(\n            name=\"vector-profile\",\n            algorithm_configuration_name=\"hnsw-algo\",\n            vectorizer_name=\"openai-vectorizer\"\n        )],\n        algorithms=[HnswAlgorithmConfiguration(name=\"hnsw-algo\")],\n        vectorizers=[AzureOpenAIVectorizer(\n            vectorizer_name=\"openai-vectorizer\",\n            parameters=AzureOpenAIVectorizerParameters(\n                resource_url=aoai_endpoint,\n                deployment_name=embedding_deployment,\n                model_name=embedding_model\n            )\n        )]\n    ),\n    semantic_search=SemanticSearch(\n        default_configuration_name=\"semantic-config\",\n        configurations=[SemanticConfiguration(\n            name=\"semantic-config\",\n            prioritized_fields=SemanticPrioritizedFields(\n                content_fields=[SemanticField(field_name=\"content\")]\n            )\n        )]\n    )\n)\n\nindex_client = SearchIndexClient(endpoint, credential)\nindex_client.create_or_update_index(index)\n```\n\n## Document Operations\n\n```python\nfrom azure.search.documents import SearchIndexingBufferedSender\n\n# Batch upload with automatic batching\nwith SearchIndexingBufferedSender(endpoint, index_name, credential) as sender:\n    sender.upload_documents(documents)\n\n# Direct operations via SearchClient\nsearch_client = SearchClient(endpoint, index_name, credential)\nsearch_client.upload_documents(documents)      # Add new\nsearch_client.merge_documents(documents)       # Update existing\nsearch_client.merge_or_upload_documents(documents)  # Upsert\nsearch_client.delete_documents(documents)      # Remove\n```\n\n## Search Patterns\n\n```python\n# Basic search\nresults = search_client.search(search_text=\"query\")\n\n# Vector search\nfrom azure.search.documents.models import VectorizedQuery\n\nresults = search_client.search(\n    search_text=None,\n    vector_queries=[VectorizedQuery(\n        vector=embedding,\n        k_nearest_neighbors=5,\n        fields=\"embedding\"\n    )]\n)\n\n# Hybrid search (vector + keyword)\nresults = search_client.search(\n    search_text=\"query\",\n    vector_queries=[VectorizedQuery(vector=embedding, k_nearest_neighbors=5, fields=\"embedding\")],\n    query_type=\"semantic\",\n    semantic_configuration_name=\"semantic-config\"\n)\n\n# With filters\nresults = search_client.search(\n    search_text=\"query\",\n    filter=\"category eq 'technology'\",\n    select=[\"id\", \"title\", \"content\"],\n    top=10\n)\n```\n\n## Agentic Retrieval (Knowledge Bases)\n\nFor LLM-powered Q&A with answer synthesis, see references\u002Fagentic-retrieval.md.\n\nKey concepts:\n- **Knowledge Source**: Points to a search index\n- **Knowledge Base**: Wraps knowledge sources + LLM for query planning and synthesis\n- **Output modes**: `EXTRACTIVE_DATA` (raw chunks) or `ANSWER_SYNTHESIS` (LLM-generated answers)\n\n## Async Pattern\n\n```python\nfrom azure.search.documents.aio import SearchClient\n\nasync with SearchClient(endpoint, index_name, credential) as client:\n    results = await client.search(search_text=\"query\")\n    async for result in results:\n        print(result[\"title\"])\n```\n\n## Best Practices\n\n1. **Use environment variables** for endpoints, keys, and deployment names\n2. **Prefer `DefaultAzureCredential`** over API keys for production\n3. **Use `SearchIndexingBufferedSender`** for batch uploads (handles batching\u002Fretries)\n4. **Always define semantic configuration** for agentic retrieval indexes\n5. **Use `create_or_update_index`** for idempotent index creation\n6. **Close clients** with context managers or explicit `close()`\n\n## Field Types Reference\n\n| EDM Type | Python | Notes |\n|----------|--------|-------|\n| `Edm.String` | str | Searchable text |\n| `Edm.Int32` | int | Integer |\n| `Edm.Int64` | int | Long integer |\n| `Edm.Double` | float | Floating point |\n| `Edm.Boolean` | bool | True\u002FFalse |\n| `Edm.DateTimeOffset` | datetime | ISO 8601 |\n| `Collection(Edm.Single)` | List[float] | Vector embeddings |\n| `Collection(Edm.String)` | List[str] | String arrays |\n\n## Error Handling\n\n```python\nfrom azure.core.exceptions import (\n    HttpResponseError,\n    ResourceNotFoundError,\n    ResourceExistsError\n)\n\ntry:\n    result = search_client.get_document(key=\"123\")\nexcept ResourceNotFoundError:\n    print(\"Document not found\")\nexcept HttpResponseError as e:\n    print(f\"Search error: {e.message}\")\n```\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n","# Azure AI Search SDK for Python\n\nFull-text, vector, and hybrid search with AI enrichment capabilities.\n\n## Installation\n\n```bash\npip install azure-search-documents\n```\n\n## Environment Variables\n\n```bash\nAZURE_SEARCH_ENDPOINT=https:\u002F\u002F\u003Cservice-name>.search.windows.net\nAZURE_SEARCH_API_KEY=\u003Cyour-api-key>\nAZURE_SEARCH_INDEX_NAME=\u003Cyour-index-name>\n```\n\n## Authentication\n\n### API Key\n\n```python\nfrom azure.search.documents import SearchClient\nfrom azure.core.credentials import AzureKeyCredential\n\nclient = SearchClient(\n    endpoint=os.environ[\"AZURE_SEARCH_ENDPOINT\"],\n    index_name=os.environ[\"AZURE_SEARCH_INDEX_NAME\"],\n    credential=AzureKeyCredential(os.environ[\"AZURE_SEARCH_API_KEY\"])\n)\n```\n\n### Entra ID (Recommended)\n\n```python\nfrom azure.search.documents import SearchClient\nfrom azure.identity import DefaultAzureCredential\n\nclient = SearchClient(\n    endpoint=os.environ[\"AZURE_SEARCH_ENDPOINT\"],\n    index_name=os.environ[\"AZURE_SEARCH_INDEX_NAME\"],\n    credential=DefaultAzureCredential()\n)\n```\n\n## Client Types\n\n| Client | Purpose |\n|--------|---------|\n| `SearchClient` | Search and document operations |\n| `SearchIndexClient` | Index management, synonym maps |\n| `SearchIndexerClient` | Indexers, data sources, skillsets |\n\n## Create Index with Vector Field\n\n```python\nfrom azure.search.documents.indexes import SearchIndexClient\nfrom azure.search.documents.indexes.models import (\n    SearchIndex,\n    SearchField,\n    SearchFieldDataType,\n    VectorSearch,\n    HnswAlgorithmConfiguration,\n    VectorSearchProfile,\n    SearchableField,\n    SimpleField\n)\n\nindex_client = SearchIndexClient(endpoint, AzureKeyCredential(key))\n\nfields = [\n    SimpleField(name=\"id\", type=SearchFieldDataType.String, key=True),\n    SearchableField(name=\"title\", type=SearchFieldDataType.String),\n    SearchableField(name=\"content\", type=SearchFieldDataType.String),\n    SearchField(\n        name=\"content_vector\",\n        type=SearchFieldDataType.Collection(SearchFieldDataType.Single),\n        searchable=True,\n        vector_search_dimensions=1536,\n        vector_search_profile_name=\"my-vector-profile\"\n    )\n]\n\nvector_search = VectorSearch(\n    algorithms=[\n        HnswAlgorithmConfiguration(name=\"my-hnsw\")\n    ],\n    profiles=[\n        VectorSearchProfile(\n            name=\"my-vector-profile\",\n            algorithm_configuration_name=\"my-hnsw\"\n        )\n    ]\n)\n\nindex = SearchIndex(\n    name=\"my-index\",\n    fields=fields,\n    vector_search=vector_search\n)\n\nindex_client.create_or_update_index(index)\n```\n\n## Upload Documents\n\n```python\nfrom azure.search.documents import SearchClient\n\nclient = SearchClient(endpoint, \"my-index\", AzureKeyCredential(key))\n\ndocuments = [\n    {\n        \"id\": \"1\",\n        \"title\": \"Azure AI Search\",\n        \"content\": \"Full-text and vector search service\",\n        \"content_vector\": [0.1, 0.2, ...]  # 1536 dimensions\n    }\n]\n\nresult = client.upload_documents(documents)\nprint(f\"Uploaded {len(result)} documents\")\n```\n\n## Keyword Search\n\n```python\nresults = client.search(\n    search_text=\"azure search\",\n    select=[\"id\", \"title\", \"content\"],\n    top=10\n)\n\nfor result in results:\n    print(f\"{result['title']}: {result['@search.score']}\")\n```\n\n## Vector Search\n\n```python\nfrom azure.search.documents.models import VectorizedQuery\n\n# Your query embedding (1536 dimensions)\nquery_vector = get_embedding(\"semantic search capabilities\")\n\nvector_query = VectorizedQuery(\n    vector=query_vector,\n    k_nearest_neighbors=10,\n    fields=\"content_vector\"\n)\n\nresults = client.search(\n    vector_queries=[vector_query],\n    select=[\"id\", \"title\", \"content\"]\n)\n\nfor result in results:\n    print(f\"{result['title']}: {result['@search.score']}\")\n```\n\n## Hybrid Search (Vector + Keyword)\n\n```python\nfrom azure.search.documents.models import VectorizedQuery\n\nvector_query = VectorizedQuery(\n    vector=query_vector,\n    k_nearest_neighbors=10,\n    fields=\"content_vector\"\n)\n\nresults = client.search(\n    search_text=\"azure search\",\n    vector_queries=[vector_query],\n    select=[\"id\", \"title\", \"content\"],\n    top=10\n)\n```\n\n## Semantic Ranking\n\n```python\nfrom azure.search.documents.models import QueryType\n\nresults = client.search(\n    search_text=\"what is azure search\",\n    query_type=QueryType.SEMANTIC,\n    semantic_configuration_name=\"my-semantic-config\",\n    select=[\"id\", \"title\", \"content\"],\n    top=10\n)\n\nfor result in results:\n    print(f\"{result['title']}\")\n    if result.get(\"@search.captions\"):\n        print(f\"  Caption: {result['@search.captions'][0].text}\")\n```\n\n## Filters\n\n```python\nresults = client.search(\n    search_text=\"*\",\n    filter=\"category eq 'Technology' and rating gt 4\",\n    order_by=[\"rating desc\"],\n    select=[\"id\", \"title\", \"category\", \"rating\"]\n)\n```\n\n## Facets\n\n```python\nresults = client.search(\n    search_text=\"*\",\n    facets=[\"category,count:10\", \"rating\"],\n    top=0  # Only get facets, no documents\n)\n\nfor facet_name, facet_values in results.get_facets().items():\n    print(f\"{facet_name}:\")\n    for facet in facet_values:\n        print(f\"  {facet['value']}: {facet['count']}\")\n```\n\n## Autocomplete & Suggest\n\n```python\n# Autocomplete\nresults = client.autocomplete(\n    search_text=\"sea\",\n    suggester_name=\"my-suggester\",\n    mode=\"twoTerms\"\n)\n\n# Suggest\nresults = client.suggest(\n    search_text=\"sea\",\n    suggester_name=\"my-suggester\",\n    select=[\"title\"]\n)\n```\n\n## Indexer with Skillset\n\n```python\nfrom azure.search.documents.indexes import SearchIndexerClient\nfrom azure.search.documents.indexes.models import (\n    SearchIndexer,\n    SearchIndexerDataSourceConnection,\n    SearchIndexerSkillset,\n    EntityRecognitionSkill,\n    InputFieldMappingEntry,\n    OutputFieldMappingEntry\n)\n\nindexer_client = SearchIndexerClient(endpoint, AzureKeyCredential(key))\n\n# Create data source\ndata_source = SearchIndexerDataSourceConnection(\n    name=\"my-datasource\",\n    type=\"azureblob\",\n    connection_string=connection_string,\n    container={\"name\": \"documents\"}\n)\nindexer_client.create_or_update_data_source_connection(data_source)\n\n# Create skillset\nskillset = SearchIndexerSkillset(\n    name=\"my-skillset\",\n    skills=[\n        EntityRecognitionSkill(\n            inputs=[InputFieldMappingEntry(name=\"text\", source=\"\u002Fdocument\u002Fcontent\")],\n            outputs=[OutputFieldMappingEntry(name=\"organizations\", target_name=\"organizations\")]\n        )\n    ]\n)\nindexer_client.create_or_update_skillset(skillset)\n\n# Create indexer\nindexer = SearchIndexer(\n    name=\"my-indexer\",\n    data_source_name=\"my-datasource\",\n    target_index_name=\"my-index\",\n    skillset_name=\"my-skillset\"\n)\nindexer_client.create_or_update_indexer(indexer)\n```\n\n## Best Practices\n\n1. **Use hybrid search** for best relevance combining vector and keyword\n2. **Enable semantic ranking** for natural language queries\n3. **Index in batches** of 100-1000 documents for efficiency\n4. **Use filters** to narrow results before ranking\n5. **Configure vector dimensions** to match your embedding model\n6. **Use HNSW algorithm** for large-scale vector search\n7. **Create suggesters** at index creation time (cannot add later)\n\n## Reference Files\n\n| File | Contents |\n|------|----------|\n| references\u002Fvector-search.md | HNSW configuration, integrated vectorization, multi-vector queries |\n| references\u002Fsemantic-ranking.md | Semantic configuration, captions, answers, hybrid patterns |\n| scripts\u002Fsetup_vector_index.py | CLI script to create vector-enabled search index |\n\n\n---\n\n## Additional Azure AI Search Patterns\n\n# Azure AI Search Python SDK\n\nWrite clean, idiomatic Python code for Azure AI Search using `azure-search-documents`.\n\n## Installation\n\n```bash\npip install azure-search-documents azure-identity\n```\n\n## Environment Variables\n\n```bash\nAZURE_SEARCH_ENDPOINT=https:\u002F\u002F\u003Csearch-service>.search.windows.net\nAZURE_SEARCH_INDEX_NAME=\u003Cindex-name>\n# For API key auth (not recommended for production)\nAZURE_SEARCH_API_KEY=\u003Capi-key>\n```\n\n## Authentication\n\n**DefaultAzureCredential (preferred)**:\n```python\nfrom azure.identity import DefaultAzureCredential\nfrom azure.search.documents import SearchClient\n\ncredential = DefaultAzureCredential()\nclient = SearchClient(endpoint, index_name, credential)\n```\n\n**API Key**:\n```python\nfrom azure.core.credentials import AzureKeyCredential\nfrom azure.search.documents import SearchClient\n\nclient = SearchClient(endpoint, index_name, AzureKeyCredential(api_key))\n```\n\n## Client Selection\n\n| Client | Purpose |\n|--------|---------|\n| `SearchClient` | Query indexes, upload\u002Fupdate\u002Fdelete documents |\n| `SearchIndexClient` | Create\u002Fmanage indexes, knowledge sources, knowledge bases |\n| `SearchIndexerClient` | Manage indexers, skillsets, data sources |\n| `KnowledgeBaseRetrievalClient` | Agentic retrieval with LLM-powered Q&A |\n\n## Index Creation Pattern\n\n```python\nfrom azure.search.documents.indexes import SearchIndexClient\nfrom azure.search.documents.indexes.models import (\n    SearchIndex, SearchField, VectorSearch, VectorSearchProfile,\n    HnswAlgorithmConfiguration, AzureOpenAIVectorizer,\n    AzureOpenAIVectorizerParameters, SemanticSearch,\n    SemanticConfiguration, SemanticPrioritizedFields, SemanticField\n)\n\nindex = SearchIndex(\n    name=index_name,\n    fields=[\n        SearchField(name=\"id\", type=\"Edm.String\", key=True),\n        SearchField(name=\"content\", type=\"Edm.String\", searchable=True),\n        SearchField(name=\"embedding\", type=\"Collection(Edm.Single)\",\n                   vector_search_dimensions=3072,\n                   vector_search_profile_name=\"vector-profile\"),\n    ],\n    vector_search=VectorSearch(\n        profiles=[VectorSearchProfile(\n            name=\"vector-profile\",\n            algorithm_configuration_name=\"hnsw-algo\",\n            vectorizer_name=\"openai-vectorizer\"\n        )],\n        algorithms=[HnswAlgorithmConfiguration(name=\"hnsw-algo\")],\n        vectorizers=[AzureOpenAIVectorizer(\n            vectorizer_name=\"openai-vectorizer\",\n            parameters=AzureOpenAIVectorizerParameters(\n                resource_url=aoai_endpoint,\n                deployment_name=embedding_deployment,\n                model_name=embedding_model\n            )\n        )]\n    ),\n    semantic_search=SemanticSearch(\n        default_configuration_name=\"semantic-config\",\n        configurations=[SemanticConfiguration(\n            name=\"semantic-config\",\n            prioritized_fields=SemanticPrioritizedFields(\n                content_fields=[SemanticField(field_name=\"content\")]\n            )\n        )]\n    )\n)\n\nindex_client = SearchIndexClient(endpoint, credential)\nindex_client.create_or_update_index(index)\n```\n\n## Document Operations\n\n```python\nfrom azure.search.documents import SearchIndexingBufferedSender\n\n# Batch upload with automatic batching\nwith SearchIndexingBufferedSender(endpoint, index_name, credential) as sender:\n    sender.upload_documents(documents)\n\n# Direct operations via SearchClient\nsearch_client = SearchClient(endpoint, index_name, credential)\nsearch_client.upload_documents(documents)      # Add new\nsearch_client.merge_documents(documents)       # Update existing\nsearch_client.merge_or_upload_documents(documents)  # Upsert\nsearch_client.delete_documents(documents)      # Remove\n```\n\n## Search Patterns\n\n```python\n# Basic search\nresults = search_client.search(search_text=\"query\")\n\n# Vector search\nfrom azure.search.documents.models import VectorizedQuery\n\nresults = search_client.search(\n    search_text=None,\n    vector_queries=[VectorizedQuery(\n        vector=embedding,\n        k_nearest_neighbors=5,\n        fields=\"embedding\"\n    )]\n)\n\n# Hybrid search (vector + keyword)\nresults = search_client.search(\n    search_text=\"query\",\n    vector_queries=[VectorizedQuery(vector=embedding, k_nearest_neighbors=5, fields=\"embedding\")],\n    query_type=\"semantic\",\n    semantic_configuration_name=\"semantic-config\"\n)\n\n# With filters\nresults = search_client.search(\n    search_text=\"query\",\n    filter=\"category eq 'technology'\",\n    select=[\"id\", \"title\", \"content\"],\n    top=10\n)\n```\n\n## Agentic Retrieval (Knowledge Bases)\n\nFor LLM-powered Q&A with answer synthesis, see references\u002Fagentic-retrieval.md.\n\nKey concepts:\n- **Knowledge Source**: Points to a search index\n- **Knowledge Base**: Wraps knowledge sources + LLM for query planning and synthesis\n- **Output modes**: `EXTRACTIVE_DATA` (raw chunks) or `ANSWER_SYNTHESIS` (LLM-generated answers)\n\n## Async Pattern\n\n```python\nfrom azure.search.documents.aio import SearchClient\n\nasync with SearchClient(endpoint, index_name, credential) as client:\n    results = await client.search(search_text=\"query\")\n    async for result in results:\n        print(result[\"title\"])\n```\n\n## Best Practices\n\n1. **Use environment variables** for endpoints, keys, and deployment names\n2. **Prefer `DefaultAzureCredential`** over API keys for production\n3. **Use `SearchIndexingBufferedSender`** for batch uploads (handles batching\u002Fretries)\n4. **Always define semantic configuration** for agentic retrieval indexes\n5. **Use `create_or_update_index`** for idempotent index creation\n6. **Close clients** with context managers or explicit `close()`\n\n## Field Types Reference\n\n| EDM Type | Python | Notes |\n|----------|--------|-------|\n| `Edm.String` | str | Searchable text |\n| `Edm.Int32` | int | Integer |\n| `Edm.Int64` | int | Long integer |\n| `Edm.Double` | float | Floating point |\n| `Edm.Boolean` | bool | True\u002FFalse |\n| `Edm.DateTimeOffset` | datetime | ISO 8601 |\n| `Collection(Edm.Single)` | List[float] | Vector embeddings |\n| `Collection(Edm.String)` | List[str] | String arrays |\n\n## Error Handling\n\n```python\nfrom azure.core.exceptions import (\n    HttpResponseError,\n    ResourceNotFoundError,\n    ResourceExistsError\n)\n\ntry:\n    result = search_client.get_document(key=\"123\")\nexcept ResourceNotFoundError:\n    print(\"Document not found\")\nexcept HttpResponseError as e:\n    print(f\"Search error: {e.message}\")\n```\n\n## When to Use\nThis skill is applicable to execute the workflow or actions described in the overview.\n",{"name":5,"risk":27,"source":33,"date_added":44,"description":7},"2026-02-27","main","7a38d8e7073e61c16eda85681cb32fb68a8657a5","skills-store\u002Fcopilot\u002Fazure-search-documents-py","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router","https:\u002F\u002Fgithub.com\u002Fsapsapshen","2026-04-14 21:12:12",{"source":8,"skillName":5,"commands":52,"prompt":62,"zipAvailable":63},[53,56,59],{"tool":54,"command":55},"npx","npx skills add sapsapshen\u002Fai-memory-router --skill azure-search-documents-py",{"tool":57,"command":58},"bunx","bunx skills add sapsapshen\u002Fai-memory-router --skill azure-search-documents-py",{"tool":60,"command":61},"pnpm","pnpm dlx skills add sapsapshen\u002Fai-memory-router --skill azure-search-documents-py","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fcopilot\u002Fazure-search-documents-py\u002FSKILL.md",true,[],[66,89,115,125,138,157],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":77,"publishedAt":39},"01M71ATQRKG48SH06FQ697T5G9","wechat-search","Search WeChat Official Account articles using OpenClaw's web search and fetch capabilities with compliance-focused design.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fwechat-search-release\u002FSKILL.md",[72],{"categoryNo":73,"categoryName":74,"taxonomyType":75,"taxonomyTypeDesc":76},"01JBSEEDCAT000000000000037","律师与法务","PROFESSION","适用职业",[78,79,22,80,81,82,83,84,85,86,87,88],"wechat search","wechat","capabilities","openclaw","design","web search","compliance","web","official","fetch","with",{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":39},"01M71ATNAVGZB35PFYM2GC5N00","trend-tap","Real-time trending topics aggregator across 7 platforms (X\u002FTwitter, Reddit, Google Trends, Hacker News, Zhihu, Bilibili, Weibo). Trigger: when user says 'trend', 'trends', 'trend tap', '热点', '热搜', or asks what is trending\u002Fhot. Do NOT use web_search — this skill already fetches live data from all platforms with zero API keys.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftrend-tap\u002FSKILL.md",[],[96,97,98,99,100,101,22,102,103,104,105,106,107,108,109,110,111,112,113,114],"trend","trend tap","tap","api keys","Bash","time","trending","hacker","aggregator","do","when","brew","live","data","google","install","read","across","api",{"skillNo":116,"name":117,"nameZh":6,"description":118,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":119,"categories":120,"keywords":121,"publishedAt":39},"01M71ATJ9AM5KM15AA8PS302EB","trend-radar","Real-time trending topics aggregator across 7 platforms (X\u002FTwitter, Reddit, Google Trends, Hacker News, Zhihu, Bilibili, Weibo). Trigger: when user says 'trend', 'trends', 'trend pulse', '热点', '热搜', or asks what is trending\u002Fhot. Do NOT use web_search — this skill already fetches live data from all platforms with zero API keys.","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftrend-radar\u002FSKILL.md",[],[122,123,96,107,108,109,110,100,22,112,124,113,114,106,104,103,102,111,101,99],"trend radar","radar","pulse",{"skillNo":126,"name":127,"nameZh":6,"description":128,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":129,"categories":130,"keywords":131,"publishedAt":39},"01M71ATGF095N3EJM9G8SD0BB5","tech-news-daily","每日科技新闻汇——从全球多个 RSS 源抓取最新科技新闻，翻译（英→中）、去重、排版成每日简报。当用户询问科技新闻、科技新鲜事、每日科技、技术动态、Daily Tech News 或类似表达时触发此技能。","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Ftech-news-daily\u002FSKILL.md",[],[132,133,134,135,136,137],"news","tech","tech news daily","daily","rss","翻译",{"skillNo":139,"name":140,"nameZh":6,"description":141,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":142,"categories":143,"keywords":149,"publishedAt":39},"01M71ATFAEAMQ17M70NQNY7SR8","summarize","Summarize URLs or files with the summarize CLI (web, PDFs, images, audio, YouTube).","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fsummarize\u002FSKILL.md",[144],{"categoryNo":145,"categoryName":146,"taxonomyType":147,"taxonomyTypeDesc":148},"01JBSEEDCAT000000000000021","资料检索与研究","SCENARIO","使用场景",[140,85,150,151,152,88,107,153,154,155,98,156,111],"Audio","cli","youtube","images","https","files","pdfs",{"skillNo":158,"name":159,"nameZh":6,"description":160,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":161,"categories":162,"keywords":163,"publishedAt":39},"01M71ATDNS3R0M4H936PACQAWZ","sonoscli","Control Sonos speakers (discover\u002Fstatus\u002Fplay\u002Fvolume\u002Fgroup).","https:\u002F\u002Fgithub.com\u002Fsapsapshen\u002Fai-memory-router\u002Fblob\u002Fmain\u002Fskills-store\u002Fopenclaw\u002Fsonoscli\u002FSKILL.md",[],[159,164,165,166,111,167,154,168,169,170,171,172],"status","play","go","latest","github","discover","control","cmd","volume"]