文档
测试
新增接口

新增/更新es库数据

POST
https://portal.dev2.supwisdom.com/portal-api/searchIndex/addIndexData

分支名称

**feature/indexManagement**

请求参数

参数名
类型
描述
必填
更新时间
indexData
Object
使用索引id 或者 使用 索引code都可以导入
必填
indexCode
string
索引Code
必填
indexId
string
索引Id
必填
indexDataList
Array
导入的数据,按照已经建好的索引
必填
2023/08/23 修改
id
string
数据Id(编辑时使用)
必填
data
Array
必填
fieldsName
string
字段名称
必填
content
string
字段对应的具体数据内容
必填

请求头

参数名
类型
描述
必填
x-id-token
string
用户token
必填

响应参数

application/json
参数名
类型
描述
必填
code
int
0:成功;-1:失败;
必填
message
string
接口访问状况信息
必填
data
Array
返回数据id
必填

说明 / 示例

```json // 新增 { "indexCode": "library", "indexDataList": [ [ { "fieldsName": "id", "content": "" }, { "fieldsName": "bookDesc", "content": "一本科技类的书" }, { "fieldsName": "bookDesc", "content": "一本科技类的书" }, { "fieldsName": "bookType", "content": "科技类" }, { "fieldsName": "bookPublishDept", "content": "清华大学出版社" }, { "fieldsName": "libraryNum", "content": "123" }, { "fieldsName": "coverImg", "content": "https://portal-minio.dev2.supwisdom.com/service/%E9%97%A8%E7%A6%81%E8%AE%BE%E5%A4%87-1645599411323.png" }, { "fieldsName": "libraryName", "content": "React设计原理" }, { "fieldsName": "url", "content": "https://portal.dev2.supwisdom.com/main.html#/global-search?keyword=%E6%B5%8B%E8%AF%95&type=service" } ], [ { "fieldsName": "id", "content": "" }, { "fieldsName": "bookDesc", "content": "一本很解决所有问题的书" }, { "fieldsName": "bookType", "content": "悬疑类" }, { "fieldsName": "bookPublishDept", "content": "复旦大学出版社" }, { "fieldsName": "libraryNum", "content": "3455" }, { "fieldsName": "coverImg", "content": "https://portal-minio.dev2.supwisdom.com/service/%E9%97%A8%E7%A6%81%E8%AE%BE%E5%A4%87-1645599411323.png" }, { "fieldsName": "libraryName", "content": "万事通" }, { "fieldsName": "url", "content": "https://portal.dev2.supwisdom.com/main.html#/global-search?keyword=%E6%B5%8B%E8%AF%95&type=service" } ] ] } ``` // 编辑 ```json { "indexCode": "library", "indexDataList": [ [ { "fieldsName": "id", "content": "1" }, { "fieldsName": "bookDesc", "content": "一本科技类的书" }, { "fieldsName": "bookType", "content": "科技类" }, { "fieldsName": "bookPublishDept", "content": "清华大学出版社" }, { "fieldsName": "libraryNum", "content": "123" }, { "fieldsName": "coverImg", "content": "https://portal-minio.dev2.supwisdom.com/service/%E9%97%A8%E7%A6%81%E8%AE%BE%E5%A4%87-1645599411323.png" }, { "fieldsName": "libraryName", "content": "React设计原理" }, { "fieldsName": "url", "content": "https://portal.dev2.supwisdom.com/main.html#/global-search?keyword=%E6%B5%8B%E8%AF%95&type=service" } ], [ { "fieldsName": "id", "content": "2" }, { "fieldsName": "bookDesc", "content": "一本很解决所有问题的书" }, { "fieldsName": "bookType", "content": "悬疑类" }, { "fieldsName": "bookPublishDept", "content": "复旦大学出版社" }, { "fieldsName": "libraryNum", "content": "3455" }, { "fieldsName": "coverImg", "content": "https://portal-minio.dev2.supwisdom.com/service/%E9%97%A8%E7%A6%81%E8%AE%BE%E5%A4%87-1645599411323.png" }, { "fieldsName": "libraryName", "content": "万事通" }, { "fieldsName": "url", "content": "https://portal.dev2.supwisdom.com/main.html#/global-search?keyword=%E6%B5%8B%E8%AF%95&type=service" } ] ] } ```