Skip to content

Commit

Permalink
refactor: force attributes update on empty index
Browse files Browse the repository at this point in the history
  • Loading branch information
vlourme committed Nov 15, 2024
1 parent 0a645c0 commit 04ab669
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,12 @@ func MakeIndex(config IndexConfig, drop bool, meta bool, ms meilisearch.ServiceM
log.WithField("index", config.Destination).Info("Created index")
}

if meta {
stats, err := idx.GetStats()
if err != nil {
return nil, err
}

if meta || stats.NumberOfDocuments == 0 {
if _, err := idx.UpdateFilterableAttributes(&config.Filterable); err != nil {
return nil, err
}
Expand Down

0 comments on commit 04ab669

Please sign in to comment.