gofound/api-test.http

88 lines
1.7 KiB
Plaintext
Raw Normal View History

2022-10-15 03:06:04 +00:00
@url=http://admin:123456@192.168.0.254:5678/api
2022-10-14 08:36:39 +00:00
# @url=http://192.168.0.254:5678/api
2022-10-15 03:06:04 +00:00
# @url=http://127.0.0.1:5678/api
2022-10-14 08:36:39 +00:00
###增加/修改索引
2022-10-15 03:06:04 +00:00
POST {{url}}/index?database=aaa HTTP/1.1
2022-10-14 08:36:39 +00:00
Authorization:
{
"id": 88188,
"text": "北京北站",
"document": {
"title": "阿森松岛所445",
"number": 223
}
}
2022-10-15 03:06:04 +00:00
###增加/修改索引 没有database时database is empty"
POST {{url}}/index?database=default HTTP/1.1
Authorization:
{
"text": "北京北三站",
"document": {
"title": "阿森松岛所245",
"number": 226
}
}
2022-10-14 08:36:39 +00:00
###批量增加/修改索引
POST {{url}}/index/batch?database=default HTTP/1.1
[{
"id": 88887,
"text": "深圳南站",
"document": {
"title": "阿森松岛所445",
"number": 223
}
},{
"id": 22222,
"text": "北京东站",
"document": {
"title": "123123123",
"number": 123123
}
}]
#### 删除索引
POST {{url}}/index/remove?database=default HTTP/1.1
{
"id":88887
}
#### 查询索引
POST {{url}}/query HTTP/1.1
{
"query":"北京",
"page":1,
"limit":10,
"order": "DESC",
"highlight": {
"preTag":"<span style='color:red'>",
"postTag":"</span>"
}
}
2022-10-15 03:06:04 +00:00
#### 查询索引2
2022-10-14 08:36:39 +00:00
POST {{url}}/query?database=default HTTP/1.1
2022-10-15 03:06:04 +00:00
{"query":"北京","page":1,"limit":10,"highlight":{"preTag":"<em style='color:red'>","postTag":"</em>"},"order":"DESC"}
#### 查询状态
GET {{url}}/status HTTP/1.1
#### 创建数据库
GET {{url}}/db/create?database=aaa HTTP/1.1
#### 删除数据库 数据库不存在
GET {{url}}/db/drop?database=aaa HTTP/1.1
#### 显示数据库
GET {{url}}/db/list HTTP/1.1
#### 在线分词
GET {{url}}/word/cut?q=上海和深圳哪个城市幸福指数高 HTTP/1.1