[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7CHAJS42RHEFYP4DDBMSA6V":3,"skill-same:01M7CHAJS42RHEFYP4DDBMSA6V":50},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":27,"commitSha":28,"skillDirectory":29,"forksCount":30,"repositoryHtmlUrl":31,"repositoryHomepageUrl":32,"ownerHtmlUrl":33,"ownerBlogUrl":6,"ownerDescription":34,"updatedAt":35,"install":36,"resources":49},"01M7CHAJS42RHEFYP4DDBMSA6V","azure-search-documents-py",null,"Azure AI Search SDK for Python. Use for vector search, hybrid search, semantic ranking, indexing, and skillsets.","YYC-Cube\u002FYYC3-Knowledge-Base","YYC-Cube","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F235006543?v=4","01M79J2PH4SWD2X0825X6PN748","yyc3","01M79J2PHVK3F6ZBYT8K2SCZCW",1,"MIT","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fazure-search-documents-py\u002FSKILL.md",[],[],"2026-11-15 14:19:17",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\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\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\n## Limitations\n- Use this skill only when the task clearly matches the scope described above.\n- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.\n- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.\n",{"name":5,"risk":24,"source":25,"date_added":26,"description":7},"unknown","community","2026-02-27","main","87afe6ce96220accf50a345dea46784c8c9f210e","YYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fazure-search-documents-py",0,"https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base","https:\u002F\u002Fkb.yyc3.top\u002F","https:\u002F\u002Fgithub.com\u002FYYC-Cube","万象归元于云枢 | 深栈智启新纪元","2026-11-10 10:37:32",{"source":8,"skillName":5,"commands":37,"prompt":47,"zipAvailable":48},[38,41,44],{"tool":39,"command":40},"npx","npx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill azure-search-documents-py",{"tool":42,"command":43},"bunx","bunx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill azure-search-documents-py",{"tool":45,"command":46},"pnpm","pnpm dlx skills add YYC-Cube\u002FYYC3-Knowledge-Base --skill azure-search-documents-py","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-Skills-技能包\u002FYYC3-Skills-技能包-antigravity-awesome-skills\u002Fskills\u002Fazure-search-documents-py\u002FSKILL.md",true,[],[51,58,65,72,79,86],{"skillNo":52,"name":53,"nameZh":6,"description":54,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":55,"categories":56,"keywords":57,"publishedAt":19},"01M7CTDWHERCXPQCP0K03A86AS","vercel-sandbox","Run agent-browser + Chrome inside Vercel Sandbox microVMs for browser automation from any Vercel-deployed app. Use when the user needs browser automation in a Vercel app (Next.js, SvelteKit, Nuxt, Remix, Astro, etc.), wants to run headless Chrome without binary size limits, needs persistent browser sessions across commands, or wants ephemeral isolated browser environments. Triggers include \"Vercel Sandbox browser\", \"microVM Chrome\", \"agent-browser in sandbox\", \"browser automation on Vercel\", or any task requiring Chrome in a Vercel Sandbox.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fvercel-sandbox\u002FSKILL.md",[],[],{"skillNo":59,"name":60,"nameZh":6,"description":61,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":62,"categories":63,"keywords":64,"publishedAt":19},"01M7CTD8D2BNJY54S65M47HEJA","slack","Interact with Slack workspaces using browser automation. Use when the user needs to check unread channels, navigate Slack, send messages, extract data, find information, search conversations, or automate any Slack task. Triggers include \"check my Slack\", \"what channels have unreads\", \"send a message to\", \"search Slack for\", \"extract from Slack\", \"find who said\", or any task requiring programmatic Slack interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fslack\u002FSKILL.md",[],[],{"skillNo":66,"name":67,"nameZh":6,"description":68,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":69,"categories":70,"keywords":71,"publishedAt":19},"01M7CTCSSB8ZP3Q58C3YZDZK1W","electron","Automate Electron desktop apps (VS Code, Slack, Discord, Figma, Notion, Spotify, etc.) using agent-browser via Chrome DevTools Protocol. Use when the user needs to interact with an Electron app, automate a desktop app, connect to a running app, control a native app, or test an Electron application. Triggers include \"automate Slack app\", \"control VS Code\", \"interact with Discord app\", \"test this Electron app\", \"connect to desktop app\", or any task requiring automation of a native Electron application.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Felectron\u002FSKILL.md",[],[],{"skillNo":73,"name":74,"nameZh":6,"description":75,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":76,"categories":77,"keywords":78,"publishedAt":19},"01M7CTCBJY76688V4DCZGWFHGQ","dogfood","Systematically explore and test a web application to find bugs, UX issues, and other problems. Use when asked to \"dogfood\", \"QA\", \"exploratory test\", \"find issues\", \"bug hunt\", \"test this app\u002Fsite\u002Fplatform\", or review the quality of a web application. Produces a structured report with full reproduction evidence -- step-by-step screenshots, repro videos, and detailed repro steps for every issue -- so findings can be handed directly to the responsible teams.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fdogfood\u002FSKILL.md",[],[],{"skillNo":80,"name":81,"nameZh":6,"description":82,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":83,"categories":84,"keywords":85,"publishedAt":19},"01M7CTC4H0FFGVEAQR9PA4GA1A","agent-browser","Browser automation CLI for AI agents. Use when the user needs to interact with websites, including navigating pages, filling forms, clicking buttons, taking screenshots, extracting data, testing web apps, or automating any browser task. Triggers include requests to \"open a website\", \"fill out a form\", \"click a button\", \"take a screenshot\", \"scrape data from a page\", \"test this web app\", \"login to a site\", \"automate browser actions\", or any task requiring programmatic web interaction.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-WebSpec-Web标准\u002FYYC3-WebSpec-Web标准-standards\u002Fbrowser-agent\u002Fskills\u002Fagent-browser\u002FSKILL.md",[],[],{"skillNo":87,"name":88,"nameZh":6,"description":89,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":90,"categories":91,"keywords":92,"publishedAt":19},"01M7CTBKVFYBG78FDSABSDJTTQ","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI, including chat interfaces. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", \"switch to --preset\", and for building a design system or applying a DESIGN.md or brand spec to shadcn\u002Fui.","https:\u002F\u002Fgithub.com\u002FYYC-Cube\u002FYYC3-Knowledge-Base\u002Fblob\u002Fmain\u002FYYC3-UI-界面组件\u002FYYC3-UI-界面组件-ui\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[]]