下拉提示词
基于建议服务域名的联想词 / 自动补全查询,路径与主搜索一致,Base URL 为建议专用域名。
接口概览
| 方法 | POST |
|---|---|
| 路径 | /1/indexes/{indexName}/query |
| Base URL 示例 | https://suggest.prophetes.ai |
| 完整 URL 示例 |
https://suggest.prophetes.ai/1/indexes/{indexName}/query
|
Demo 下载
下载我们的官方 Demo,快速将 Insight 搜索集成到您的应用中:
鉴权
| Header | 说明 |
|---|---|
x-insight-application-id |
应用 ID |
x-insight-api-key |
API Key |
Content-Type |
application/json |
请求体格式
{
"query": "so",
"params": "hitsPerPage=10"
}
请求参数
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
query |
string | 否 | "" |
搜索关键词 |
params |
string | 否 | "" |
额外控制参数(query string 形式) |
响应结构
返回 hits 建议列表及
nbHits、page、hitsPerPage、processingTimeMS
等元数据;每条命中含
query、objectID、nbWords、popularity、_highlightResult
等。
示例
curl -X POST "https://suggest.prophetes.ai/1/indexes/INSIGHT_INDEX_NAME/query" \
-H "x-insight-application-id: YOUR_APPLICATION_ID" \
-H "x-insight-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"query":"so","params":"hitsPerPage=10"}'