feat(search): align message result payloads
This commit is contained in:
@@ -173,7 +173,10 @@ func reindexMessages(ctx context.Context, engine search.SearchEngine, db *gorm.D
|
||||
var lastID uint
|
||||
for {
|
||||
var rows []model.Message
|
||||
q := db.WithContext(ctx).Where("id > ?", lastID).Order("id ASC").Limit(batchSize)
|
||||
q := db.WithContext(ctx).
|
||||
Preload("Conversation").
|
||||
Preload("Attachments", func(db *gorm.DB) *gorm.DB { return db.Order("id ASC") }).
|
||||
Where("id > ?", lastID).Order("id ASC").Limit(batchSize)
|
||||
if accountID != 0 {
|
||||
q = q.Where("account_id = ?", accountID)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user