This commit is contained in:
Liang Ding 2022-12-02 17:30:16 +08:00
parent dc5eaa777e
commit fa5e60750a
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 133 additions and 116 deletions

View file

@ -220,12 +220,17 @@ func fullTextSearchBlock(c *gin.Context) {
if nil != methodArg {
method = int(methodArg.(float64))
}
orderByArg := arg["orderBy"]
var orderBy int // 0按块类型默认1按创建时间升序2按创建时间降序3按更新时间升序4按更新时间降序5按内容顺序仅在按文档分组时
if nil != orderByArg {
orderBy = int(orderByArg.(float64))
}
groupByArg := arg["groupBy"]
var groupBy int // 0不分组1按文档分组
if nil != groupByArg {
groupBy = int(groupByArg.(float64))
}
blocks, matchedBlockCount, matchedRootCount := model.FullTextSearchBlock(query, boxes, paths, types, method, groupBy)
blocks, matchedBlockCount, matchedRootCount := model.FullTextSearchBlock(query, boxes, paths, types, method, orderBy, groupBy)
ret.Data = map[string]interface{}{
"blocks": blocks,
"matchedBlockCount": matchedBlockCount,