mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 23:20:13 +01:00
🐛 Search ignore is not working in some cases
This commit is contained in:
parent
512e72700c
commit
655b6bc418
2 changed files with 18 additions and 28 deletions
|
|
@ -31,7 +31,6 @@ import (
|
|||
sqlparser2 "github.com/rqlite/sql"
|
||||
"github.com/siyuan-note/logging"
|
||||
"github.com/siyuan-note/siyuan/kernel/treenode"
|
||||
"github.com/siyuan-note/siyuan/kernel/util"
|
||||
)
|
||||
|
||||
func QueryEmptyContentEmbedBlocks() (ret []*Block) {
|
||||
|
|
@ -123,32 +122,6 @@ func queryBlockIDByParentID(parentID string) (ret []string) {
|
|||
return
|
||||
}
|
||||
|
||||
func QueryRecentUpdatedBlocks() (ret []*Block) {
|
||||
sqlStmt := "SELECT * FROM blocks WHERE type = 'p' AND length > 1 ORDER BY updated DESC LIMIT 16"
|
||||
if util.ContainerIOS == util.Container || util.ContainerAndroid == util.Container {
|
||||
sqlStmt = "SELECT * FROM blocks WHERE type = 'd' ORDER BY updated DESC LIMIT 16"
|
||||
}
|
||||
rows, err := query(sqlStmt)
|
||||
if err != nil {
|
||||
logging.LogErrorf("sql query [%s] failed: %s", sqlStmt, err)
|
||||
return
|
||||
}
|
||||
defer rows.Close()
|
||||
for rows.Next() {
|
||||
if block := scanBlockRows(rows); nil != block {
|
||||
ret = append(ret, block)
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func QueryBlockByNameOrAlias(rootID, text string) (ret *Block) {
|
||||
sqlStmt := "SELECT * FROM blocks WHERE root_id = ? AND (alias LIKE ? OR name = ?)"
|
||||
row := queryRow(sqlStmt, rootID, "%"+text+"%", text)
|
||||
ret = scanBlockRow(row)
|
||||
return
|
||||
}
|
||||
|
||||
func QueryBlockAliases(rootID string) (ret []string) {
|
||||
sqlStmt := "SELECT alias FROM blocks WHERE root_id = ? AND alias != ''"
|
||||
rows, err := query(sqlStmt, rootID)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue