mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-24 02:20:13 +01:00
🎨 Replace All is no longer affected by pagination https://github.com/siyuan-note/siyuan/issues/8265
This commit is contained in:
parent
fa8e910bed
commit
c49ac8990c
2 changed files with 32 additions and 23 deletions
|
|
@ -35,7 +35,7 @@ func findReplace(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
_, _, paths, boxes, types, method, orderBy, groupBy := parseSearchArgs(arg)
|
||||
_, _, _, paths, boxes, types, method, orderBy, groupBy := parseSearchArgs(arg)
|
||||
|
||||
k := arg["k"].(string)
|
||||
r := arg["r"].(string)
|
||||
|
|
@ -215,8 +215,8 @@ func fullTextSearchBlock(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
page, query, paths, boxes, types, method, orderBy, groupBy := parseSearchArgs(arg)
|
||||
blocks, matchedBlockCount, matchedRootCount, pageCount := model.FullTextSearchBlock(query, boxes, paths, types, method, orderBy, groupBy, page)
|
||||
page, pageSize, query, paths, boxes, types, method, orderBy, groupBy := parseSearchArgs(arg)
|
||||
blocks, matchedBlockCount, matchedRootCount, pageCount := model.FullTextSearchBlock(query, boxes, paths, types, method, orderBy, groupBy, page, pageSize)
|
||||
ret.Data = map[string]interface{}{
|
||||
"blocks": blocks,
|
||||
"matchedBlockCount": matchedBlockCount,
|
||||
|
|
@ -225,7 +225,7 @@ func fullTextSearchBlock(c *gin.Context) {
|
|||
}
|
||||
}
|
||||
|
||||
func parseSearchArgs(arg map[string]interface{}) (page int, query string, paths, boxes []string, types map[string]bool, method, orderBy, groupBy int) {
|
||||
func parseSearchArgs(arg map[string]interface{}) (page, pageSize int, query string, paths, boxes []string, types map[string]bool, method, orderBy, groupBy int) {
|
||||
page = 1
|
||||
if nil != arg["page"] {
|
||||
page = int(arg["page"].(float64))
|
||||
|
|
@ -234,6 +234,14 @@ func parseSearchArgs(arg map[string]interface{}) (page int, query string, paths,
|
|||
page = 1
|
||||
}
|
||||
|
||||
pageSize = 32
|
||||
if nil != arg["pageSize"] {
|
||||
pageSize = int(arg["pageSize"].(float64))
|
||||
}
|
||||
if 0 >= pageSize {
|
||||
pageSize = 32
|
||||
}
|
||||
|
||||
queryArg := arg["query"]
|
||||
if nil != queryArg {
|
||||
query = queryArg.(string)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue