mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-09-22 00:20:47 +02: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 {
|
||||
for _, box := range boxes {
|
||||
if flashcard {
|
||||
|
|
|
@ -69,8 +69,8 @@ func queryBlockHashes(rootID string) (ret map[string]string) {
|
|||
return
|
||||
}
|
||||
|
||||
func QueryRootBlockByCondition(condition string) (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"
|
||||
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 " + strconv.Itoa(limit)
|
||||
rows, err := query(sqlStmt)
|
||||
if err != nil {
|
||||
logging.LogErrorf("sql query [%s] failed: %s", sqlStmt, err)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue