Remove deleted bookmark words from the index

This commit is contained in:
2022-05-31 08:40:44 +09:30
parent a144c6b383
commit 28f3ca73d0
3 changed files with 5 additions and 11 deletions

View File

@@ -45,7 +45,10 @@ func (m *BookmarkManager) DeleteBookmark(bm *entity.Bookmark) error {
return fmt.Errorf("bookmark does not exist")
}
// delete it
m.db.store.DeleteMatching(bm, bolthold.Where("ID").Eq(bm.ID))
// delete all the index entries
m.db.UpdateIndexForWordsByID([]string{}, bm.ID)
return nil
}