This commit is contained in:
Liang Ding 2022-11-28 11:24:31 +08:00
parent 16e2d7122a
commit 4b7daad3af
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 101 additions and 16 deletions

View file

@ -207,17 +207,17 @@ func fullTextSearchBlock(c *gin.Context) {
types[t] = b.(bool)
}
}
querySyntaxArg := arg["querySyntax"]
var querySyntax bool
if nil != querySyntaxArg {
querySyntax = querySyntaxArg.(bool)
methodArg := arg["method"]
var method int // 0文本1查询语法2SQL3正则表达式
if nil != methodArg {
method = int(methodArg.(float64))
}
groupByArg := arg["groupBy"]
var groupBy int // 0不分组1按文档分组
if nil != groupByArg {
groupBy = int(groupByArg.(float64))
}
blocks, matchedBlockCount, matchedRootCount := model.FullTextSearchBlock(query, box, path, types, querySyntax, groupBy)
blocks, matchedBlockCount, matchedRootCount := model.FullTextSearchBlock(query, box, path, types, method, groupBy)
ret.Data = map[string]interface{}{
"blocks": blocks,
"matchedBlockCount": matchedBlockCount,