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

This commit is contained in:
Liang Ding 2022-08-30 00:04:11 +08:00
parent b1552281c4
commit 4908d84d2d
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
4 changed files with 13 additions and 6 deletions

View file

@ -264,14 +264,21 @@ type HistoryItem struct {
func FullTextSearchHistory(query, box, op string, typ, page int) (ret []*History, pageCount, totalCount int) {
query = gulu.Str.RemoveInvisible(query)
query = stringQuery(query)
if "" != query {
query = stringQuery(query)
}
pageSize := 32
from := (page - 1) * pageSize
to := page * pageSize
table := "histories_fts_case_insensitive"
stmt := "SELECT * FROM " + table + " WHERE " + table + " MATCH '{title content}:(" + query + ")'"
stmt := "SELECT * FROM " + table + " WHERE "
if "" != query {
stmt += table + " MATCH '{title content}:(" + query + ")'"
} else {
stmt += "1=1"
}
if "all" != op {
stmt += " AND op = '" + op + "'"
}