Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Manually optimize the data index to reduce space usage and improve performance https://github.com/siyuan-note/siyuan/issues/15663

Daniel55541f62b06c
diff --git a/app/src/dialog/processSystem.ts b/app/src/dialog/processSystem.ts
index 7ab3d11a8d..df1ff6c24d 100644
--- a/app/src/dialog/processSystem.ts
+++ b/app/src/dialog/processSystem.ts
@@ -386,7 +386,7 @@ export const transactionError = () => {
export const refreshFileTree = (cb?: () => void) => {
window.siyuan.storage[Constants.LOCAL_FILEPOSITION] = {};
setStorageVal(Constants.LOCAL_FILEPOSITION, window.siyuan.storage[Constants.LOCAL_FILEPOSITION]);
- fetchPost("/api/filetree/refreshFiletree", {}, () => {
+ fetchPost("/api/system/rebuildDataIndex", {}, () => {
if (cb) {
cb();
}
diff --git a/kernel/api/filetree.go b/kernel/api/filetree.go
index 447a813fec..4e2fd6a6b9 100644
--- a/kernel/api/filetree.go
+++ b/kernel/api/filetree.go
@@ -221,13 +221,6 @@ func removeIndexes(c *gin.Context) {
model.RemoveIndexes(paths)
}
-func refreshFiletree(c *gin.Context) {
- ret := gulu.Ret.NewResult()
- defer c.JSON(http.StatusOK, ret)
-
- model.FullReindex()
-}
-
func doc2Heading(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
diff --git a/kernel/api/router.go b/kernel/api/router.go
index 60ef855476..b8e78e8e02 100644
--- a/kernel/api/router.go
+++ b/kernel/api/router.go
@@ -123,7 +123,6 @@ func ServeAPI(ginServer *gin.Engine) {
ginServer.Handle("POST", "/api/filetree/doc2Heading", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, doc2Heading)
ginServer.Handle("POST", "/api/filetree/heading2Doc", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, heading2Doc)
ginServer.Handle("POST", "/api/filetree/li2Doc", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, li2Doc)
- ginServer.Handle("POST", "/api/filetree/refreshFiletree", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, refreshFiletree)
ginServer.Handle("POST", "/api/filetree/upsertIndexes", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, upsertIndexes)
ginServer.Handle("POST", "/api/filetree/removeIndexes", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, removeIndexes)
ginServer.Handle("POST", "/api/filetree/listDocTree", model.CheckAuth, model.CheckAdminRole, model.CheckReadonly, listDocTree)