索引批量上传
向指定索引批量写入或更新文档。
接口概览
| 方法 | POST |
|---|---|
| 路径 | /1/indexes/{indexName}/batch |
| Base URL 示例 | https://api.prophetes.ai |
| 完整 URL 示例 |
https://api.prophetes.ai/1/indexes/{indexName}/batch
|
Demo 下载
下载我们的官方 Demo,快速将 Insight 搜索集成到您的应用中:
鉴权
请求头需携带:
| Header | 说明 |
|---|---|
x-insight-application-id |
应用 ID |
x-insight-api-key |
API Key(需具备写入权限) |
Content-Type |
application/json |
请求体格式
请求体为 JSON 数组,数组元素为待写入的文档对象(字段以您的索引 schema 为准)。
[
{ "status": 2, "ct": "2026-03-03 14:47:02", "ut": "2026-03-03 14:47:02" },
{ "status": 3, "ct": "2026-03-03 14:47:12", "ut": "2026-03-03 14:47:12" }
]
响应结构
{
"objectIDs": [
"bc00308e8ff44bdaad9ccf2277f6fcea",
"6793c499c2f14419acca9c0ce94403a8"
],
"taskID": 1776101089469
}
示例
curl 'https://api.prophetes.ai/1/indexes/INSIGHT_INDEX_NAME/batch' \
-X POST \
-H 'x-insight-api-key: INSIGHT_API_KEY' \
-H 'x-insight-application-id: INSIGHT_APPLICATION_ID' \
-H 'Content-Type: application/json' \
--data-raw '[{"status": 2, "ct": "2026-03-03 14:47:02", "ut": "2026-03-03 14:47:02"}, {"status": 3, "ct": "2026-03-03 14:47:12", "ut": "2026-03-03 14:47:12"}]'