mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-28 12:28:48 +01:00
🎨 自动校验索引时考虑大小写忽略表 Fix https://github.com/siyuan-note/siyuan/issues/7125
This commit is contained in:
parent
f84efb9efa
commit
a00af1bd6c
3 changed files with 29 additions and 4 deletions
|
|
@ -1309,16 +1309,16 @@ func autoFixIndex() {
|
|||
rootUpdatedMap := treenode.GetRootUpdated()
|
||||
dbRootUpdatedMap, err := sql.GetRootUpdated("blocks")
|
||||
if nil == err {
|
||||
reindexTreeByUpdated(rootUpdatedMap, dbRootUpdatedMap)
|
||||
reindexTreeByUpdated(rootUpdatedMap, dbRootUpdatedMap, "blocks")
|
||||
}
|
||||
dbFtsRootUpdatedMap, err := sql.GetRootUpdated("blocks_fts")
|
||||
if nil == err {
|
||||
reindexTreeByUpdated(rootUpdatedMap, dbFtsRootUpdatedMap)
|
||||
reindexTreeByUpdated(rootUpdatedMap, dbFtsRootUpdatedMap, "blocks_fts")
|
||||
}
|
||||
if !Conf.Search.CaseSensitive {
|
||||
dbFtsRootUpdatedMap, err := sql.GetRootUpdated("blocks_fts_case_insensitive")
|
||||
if nil == err {
|
||||
reindexTreeByUpdated(rootUpdatedMap, dbFtsRootUpdatedMap)
|
||||
reindexTreeByUpdated(rootUpdatedMap, dbFtsRootUpdatedMap, "blocks_fts_case_insensitive")
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1345,7 +1345,7 @@ func autoFixIndex() {
|
|||
util.PushStatusBar(Conf.Language(185))
|
||||
}
|
||||
|
||||
func reindexTreeByUpdated(rootUpdatedMap, dbRootUpdatedMap map[string]string) {
|
||||
func reindexTreeByUpdated(rootUpdatedMap, dbRootUpdatedMap map[string]string, blocksTable string) {
|
||||
i := -1
|
||||
size := len(rootUpdatedMap)
|
||||
for rootID, updated := range rootUpdatedMap {
|
||||
|
|
@ -1372,6 +1372,13 @@ func reindexTreeByUpdated(rootUpdatedMap, dbRootUpdatedMap map[string]string) {
|
|||
continue
|
||||
}
|
||||
}
|
||||
|
||||
for rootID, _ := range dbRootUpdatedMap {
|
||||
if _, ok := rootUpdatedMap[rootID]; !ok {
|
||||
logging.LogWarnf("tree [%s] is not in block tree, remove it from [%s]", rootID, blocksTable)
|
||||
sql.DeleteTree(blocksTable, rootID)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func reindexTreeByPath(box, p string, i, size int) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue