diff --git a/persistence/album_repository.go b/persistence/album_repository.go index 797d1203..c5d7a206 100644 --- a/persistence/album_repository.go +++ b/persistence/album_repository.go @@ -123,6 +123,10 @@ group by album_id order by f.id`, strings.Join(ids, "','")) } else { toInsert = append(toInsert, al.album) } + err := r.addToIndex(o, r.tableName, al.ID, al.Name) + if err != nil { + return err + } } if len(toInsert) > 0 { n, err := o.InsertMulti(100, toInsert) diff --git a/persistence/artist_repository.go b/persistence/artist_repository.go index f237ec4e..b46122cd 100644 --- a/persistence/artist_repository.go +++ b/persistence/artist_repository.go @@ -127,6 +127,10 @@ where f.artist_id in ('%s') group by f.artist_id order by f.id`, strings.Join(id } else { toInsert = append(toInsert, ar.artist) } + err := r.addToIndex(o, r.tableName, ar.ID, ar.Name) + if err != nil { + return err + } } if len(toInsert) > 0 { n, err := o.InsertMulti(100, toInsert) diff --git a/persistence/searchable_repository.go b/persistence/searchable_repository.go index 7ee9d180..7bc79e14 100644 --- a/persistence/searchable_repository.go +++ b/persistence/searchable_repository.go @@ -12,7 +12,7 @@ import ( type Search struct { ID string `orm:"pk;column(id)"` Table string `orm:"index"` - FullText string `orm:"type(text)"` + FullText string `orm:"index"` } type searchableRepository struct {