🎨 文件历史支持按文档名搜索 Fix https://github.com/siyuan-note/siyuan/issues/6257

This commit is contained in:
Liang Ding 2022-10-18 18:27:35 +08:00
parent ae98a6dba5
commit 16e2bc6904
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
2 changed files with 13 additions and 7 deletions

View file

@ -343,7 +343,11 @@ func FullTextSearchHistory(query, box, op string, typ, page int) (ret []*History
stmt += "1=1"
}
if HistoryTypeDoc == typ {
if HistoryTypeDocName == typ {
stmt = strings.ReplaceAll(stmt, "{title content}", "{title}")
}
if HistoryTypeDocName == typ || HistoryTypeDoc == typ {
if "all" != op {
stmt += " AND op = '" + op + "'"
}
@ -578,8 +582,9 @@ func ReindexHistory() (err error) {
var validOps = []string{HistoryOpClean, HistoryOpUpdate, HistoryOpDelete, HistoryOpFormat, HistoryOpSync}
const (
HistoryTypeDoc = 0
HistoryTypeAsset = 1
HistoryTypeDocName = 0
HistoryTypeDoc = 1
HistoryTypeAsset = 2
)
func indexHistoryDir(name string, luteEngine *lute.Lute) {