---
title: "混合搜索"
method: POST
path: "/knowledge-bases/{id}/hybrid-search"
tags: ["知识库"]
---

# 混合搜索

`POST /knowledge-bases/{id}/hybrid-search`

在知识库中执行向量和关键词混合搜索。推荐使用 POST；GET 携带 JSON 请求体仍受支持（兼容旧客户端）。

## Path parameters

- `id` string, required

## Request body

- GithubComTencentWeKnoraInternalTypesSearchParams
  - `disable_keywords_match` boolean
  - `disable_vector_match` boolean
  - `keyword_threshold` number
  - `knowledge_base_ids` string[] — KnowledgeBaseIDs overrides the single KB ID passed to HybridSearch, allowing a single retrieval call to span multiple KBs that share the same embedding model. When empty, HybridSearch uses its own id parameter.
  - `knowledge_ids` string[]
  - `match_count` integer
  - `only_recommended` boolean
  - `query_embedding` number[]
  - `query_text` string — QueryText is required unless query_embedding is provided, keyword matching is disabled, and vector matching remains enabled.
  - `scope_tag_ids` string[]
  - `skip_context_enrichment` boolean — SkipContextEnrichment skips fetching parent, nearby, and relation chunks in processSearchResults. Used by the chat pipeline where context assembly is handled separately in the merge stage.
  - `tag_ids` string[] — Tag IDs for filtering (used for FAQ priority filtering)
  - `vector_threshold` number

## Response `200`

搜索结果

- object

## Other responses

- `400` — 请求参数错误

---

[API](https://skmtc.net/tencentblueking/apis/weknora-api.md) · [All operations](https://skmtc.net/tencentblueking/apis/weknora-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/tencentblueking/weknora-api/versions/d6921ae22ce0/schema)
