🎨 Add Settings - Search - Index - Asset path Fix https://github.com/siyuan-note/siyuan/issues/8221

This commit is contained in:
Liang Ding 2023-05-10 10:30:05 +08:00
parent 49c5e3be9d
commit 3790507ee2
No known key found for this signature in database
GPG key ID: 136F30F901A2231D
16 changed files with 64 additions and 26 deletions

View file

@ -310,6 +310,8 @@ func setSearch(c *gin.Context) {
}
oldCaseSensitive := model.Conf.Search.CaseSensitive
oldIndexAssetPath := model.Conf.Search.IndexAssetPath
oldVirtualRefName := model.Conf.Search.VirtualRefName
oldVirtualRefAlias := model.Conf.Search.VirtualRefAlias
oldVirtualRefAnchor := model.Conf.Search.VirtualRefAnchor
@ -317,8 +319,11 @@ func setSearch(c *gin.Context) {
model.Conf.Search = s
model.Conf.Save()
sql.SetCaseSensitive(s.CaseSensitive)
if s.CaseSensitive != oldCaseSensitive {
sql.SetIndexAssetPath(s.IndexAssetPath)
if needFullReindex := s.CaseSensitive != oldCaseSensitive || s.IndexAssetPath != oldIndexAssetPath; needFullReindex {
model.FullReindex()
}