Removing purged ids from the search index
This commit is contained in:
@@ -17,6 +17,10 @@ type Search interface {
|
||||
IndexAlbum(al *domain.Album) error
|
||||
IndexMediaFile(mf *domain.MediaFile) error
|
||||
|
||||
RemoveArtist(ids []string) error
|
||||
RemoveAlbum(ids []string) error
|
||||
RemoveMediaFile(ids []string) error
|
||||
|
||||
SearchArtist(q string, offset int, size int) (Results, error)
|
||||
SearchAlbum(q string, offset int, size int) (Results, error)
|
||||
SearchSong(q string, offset int, size int) (Results, error)
|
||||
@@ -63,6 +67,18 @@ func (s search) IndexMediaFile(mf *domain.MediaFile) error {
|
||||
return s.idxSong.Index(mf.Id, sanitize.Accents(strings.ToLower(mf.Title)))
|
||||
}
|
||||
|
||||
func (s search) RemoveArtist(ids []string) error {
|
||||
return s.idxArtist.Remove(ids...)
|
||||
}
|
||||
|
||||
func (s search) RemoveAlbum(ids []string) error {
|
||||
return s.idxAlbum.Remove(ids...)
|
||||
}
|
||||
|
||||
func (s search) RemoveMediaFile(ids []string) error {
|
||||
return s.idxSong.Remove(ids...)
|
||||
}
|
||||
|
||||
func (s search) SearchArtist(q string, offset int, size int) (Results, error) {
|
||||
q = sanitize.Accents(strings.ToLower(strings.TrimSuffix(q, "*")))
|
||||
min := offset
|
||||
|
||||
Reference in New Issue
Block a user