本页内容

API参考:搜索

搜索端点会对租户内容执行全局(语义)搜索。

全局搜索租户中的角色、流程、元素、文档、版本和评论

按租户限制速率;429响应包含共享消息正文({“message”: “搜索请求过多,请降低请求频率。”})。

端点: POST /v1/tenant/{tenantId}/search

**身份验证:**租户范围API密钥 · read范围

参数:

名称 类型 位置 必填 描述
tenantId string 路径 格式:uuid

请求正文:

{
	"query": "string",
	"mode": "semantic",
	"categories": [
		"role"
	],
	"processId": "00000000-0000-0000-0000-000000000000",
	"k": 0
}
字段 类型 必填 描述
query string 搜索查询
最大长度:1000
mode semantic | exact | hybrid 语义 = 嵌入,精确 = 字面匹配,混合 = 两者兼有
允许值:semanticexacthybrid
默认值:hybrid
categories role | process | element | documentation | version | comment[] 将结果限制为这些类别
processId string 将结果限制为单个流程
格式:uuid
k integer 返回的结果数
默认值:20
最小值:1
最大值:50

响应(200):

搜索结果(命中项、计数、总数、建议)

{
	"hits": [
		{
			"category": "role",
			"entityType": "role",
			"entityId": "string",
			"subKey": "string",
			"title": "string",
			"snippet": "string",
			"score": 0,
			"processId": "00000000-0000-0000-0000-000000000000",
			"processDisplayName": "string",
			"elementType": "string",
			"docSection": "string",
			"url": "string"
		}
	],
	"counts": {},
	"total": 0,
	"suggestions": [
		"string"
	]
}
字段 类型 必填 描述
hits object[]
counts object
total number
suggestions string[]

错误:

  • 401缺少、无效、已禁用或已过期的API密钥
  • 429触发速率限制:请参阅端点文档中的速率限制