Merge branch 'dev'
This commit is contained in:
commit
4c1b66acdf
|
|
@ -15,6 +15,7 @@ ENV TZ=Asia/Shanghai \
|
|||
APP_DIR=/usr/local/go_found
|
||||
|
||||
COPY --from=builder /app/gofound ${APP_DIR}/gofound
|
||||
COPY --from=builder /app/config.yaml ${APP_DIR}/config.yaml
|
||||
|
||||
WORKDIR ${APP_DIR}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
# @url=http://admin:123456@192.168.0.254:5678/api
|
||||
@url=http://admin:123456@192.168.0.254:5678/api
|
||||
# @url=http://192.168.0.254:5678/api
|
||||
@url=http://127.0.0.1:5678/api
|
||||
# @url=http://127.0.0.1:5678/api
|
||||
|
||||
###增加/修改索引
|
||||
POST {{url}}/index?database=default HTTP/1.1
|
||||
POST {{url}}/index?database=aaa HTTP/1.1
|
||||
Authorization:
|
||||
|
||||
{
|
||||
|
|
@ -15,6 +15,18 @@ Authorization:
|
|||
}
|
||||
}
|
||||
|
||||
###增加/修改索引 没有database时database is empty"
|
||||
POST {{url}}/index?database=default HTTP/1.1
|
||||
Authorization:
|
||||
|
||||
{
|
||||
"text": "北京北三站",
|
||||
"document": {
|
||||
"title": "阿森松岛所245",
|
||||
"number": 226
|
||||
}
|
||||
}
|
||||
|
||||
###批量增加/修改索引
|
||||
POST {{url}}/index/batch?database=default HTTP/1.1
|
||||
|
||||
|
|
@ -55,7 +67,22 @@ POST {{url}}/query HTTP/1.1
|
|||
}
|
||||
}
|
||||
|
||||
#### 查询索引
|
||||
#### 查询索引2
|
||||
POST {{url}}/query?database=default HTTP/1.1
|
||||
|
||||
{"query":"北京","page":1,"limit":10,"highlight":{"preTag":"<em style='color:red'>","postTag":"</em>"},"order":"DESC"}
|
||||
{"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
|
||||
|
|
@ -14,8 +14,7 @@ func AddIndex(c *gin.Context) {
|
|||
}
|
||||
dbName := c.Query("database")
|
||||
if dbName == "" {
|
||||
ResponseErrorWithMsg(c, "database is empty")
|
||||
return
|
||||
dbName = "default"
|
||||
}
|
||||
err := srv.Index.AddIndex(dbName, document)
|
||||
if err != nil {
|
||||
|
|
@ -36,8 +35,7 @@ func BatchAddIndex(c *gin.Context) {
|
|||
|
||||
dbName := c.Query("database")
|
||||
if dbName == "" {
|
||||
ResponseErrorWithMsg(c, "database is empty")
|
||||
return
|
||||
dbName = "default"
|
||||
}
|
||||
|
||||
err := srv.Index.BatchAddIndex(dbName, documents)
|
||||
|
|
|
|||
Loading…
Reference in New Issue