🎨 提供重建单个文档索引的 API https://github.com/siyuan-note/siyuan/issues/5719

This commit is contained in:
Liang Ding 2022-08-27 22:21:59 +08:00
parent 0959994e73
commit da5f467a5e
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
3 changed files with 33 additions and 0 deletions

View file

@ -449,6 +449,19 @@ func parseKTree(kramdown []byte) (ret *parse.Tree) {
return
}
func ReindexTree(path string) (err error) {
luteEngine := NewLute()
tree, err := loadTree(path, luteEngine)
if nil != err {
return
}
treenode.ReindexBlockTree(tree)
sql.UpsertTreeQueue(tree)
sql.WaitForWritingDatabase()
return
}
func RefreshFileTree() {
WaitForWritingFiles()