瀏覽代碼

:art: 数据历史文档中支持操作类型过滤 https://github.com/siyuan-note/siyuan/issues/5754

Liang Ding 2 年之前
父節點
當前提交
49e6d708d6
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      kernel/model/history.go

+ 2 - 1
kernel/model/history.go

@@ -283,7 +283,7 @@ func FullTextSearchHistory(query, box, op string, typ, page int) (ret []*History
 	}
 
 	if HistoryTypeDoc == typ {
-		stmt += " AND path LIKE '%/" + box + "/%'"
+		stmt += " AND path LIKE '%/" + box + "/%' AND path LIKE '%.sy'"
 	} else if HistoryTypeAsset == typ {
 		stmt += " AND path LIKE '%/assets/%'"
 	}
@@ -494,6 +494,7 @@ func ReindexHistory() (err error) {
 		return
 	}
 
+	sql.InitHistoryDatabase(true)
 	lutEngine := NewLute()
 	for _, historyDir := range historyDirs {
 		if !historyDir.IsDir() {