mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-30 13:28:48 +01:00
🎨 搜索支持按文档分组和按文档树结构展现 https://github.com/siyuan-note/siyuan/issues/4772
This commit is contained in:
parent
2a948bbb0d
commit
fb14f7a46a
2 changed files with 40 additions and 4 deletions
|
|
@ -212,7 +212,12 @@ func fullTextSearchBlock(c *gin.Context) {
|
|||
if nil != querySyntaxArg {
|
||||
querySyntax = querySyntaxArg.(bool)
|
||||
}
|
||||
blocks, matchedBlockCount, matchedRootCount := model.FullTextSearchBlock(query, box, path, types, querySyntax)
|
||||
groupByArg := arg["groupBy"]
|
||||
var groupBy int // 0:不分组,1:按文档分组,2:按文档树结构分组
|
||||
if nil != groupByArg {
|
||||
groupBy = int(groupByArg.(float64))
|
||||
}
|
||||
blocks, matchedBlockCount, matchedRootCount := model.FullTextSearchBlock(query, box, path, types, querySyntax, groupBy)
|
||||
ret.Data = map[string]interface{}{
|
||||
"blocks": blocks,
|
||||
"matchedBlockCount": matchedBlockCount,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue