mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
This commit is contained in:
parent
de9e648e9e
commit
a4f03191fa
2 changed files with 3 additions and 3 deletions
|
|
@ -187,7 +187,7 @@ func SearchDocsByKeyword(keyword string, flashcard bool) (ret []map[string]strin
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
rootBlocks = sql.QueryRootBlockByCondition(condition)
|
rootBlocks = sql.QueryRootBlockByCondition(condition, Conf.Search.Limit)
|
||||||
} else {
|
} else {
|
||||||
for _, box := range boxes {
|
for _, box := range boxes {
|
||||||
if flashcard {
|
if flashcard {
|
||||||
|
|
|
||||||
|
|
@ -69,8 +69,8 @@ func queryBlockHashes(rootID string) (ret map[string]string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func QueryRootBlockByCondition(condition string) (ret []*Block) {
|
func QueryRootBlockByCondition(condition string, limit int) (ret []*Block) {
|
||||||
sqlStmt := "SELECT *, length(hpath) - length(replace(hpath, '/', '')) AS lv FROM blocks WHERE type = 'd' AND " + condition + " ORDER BY box DESC,lv ASC LIMIT 128"
|
sqlStmt := "SELECT *, length(hpath) - length(replace(hpath, '/', '')) AS lv FROM blocks WHERE type = 'd' AND " + condition + " ORDER BY box DESC,lv ASC LIMIT " + strconv.Itoa(limit)
|
||||||
rows, err := query(sqlStmt)
|
rows, err := query(sqlStmt)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logging.LogErrorf("sql query [%s] failed: %s", sqlStmt, err)
|
logging.LogErrorf("sql query [%s] failed: %s", sqlStmt, err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue