Update Meili to 0.35.0 (#588)

This commit is contained in:
Thomas Miceli
2025-12-28 14:53:48 +08:00
committed by GitHub
parent f874b81e2e
commit 7b4dab143b
3 changed files with 5 additions and 5 deletions

View File

@@ -85,12 +85,12 @@ func (i *MeiliIndexer) Add(gist *Gist) error {
return errors.New("failed to add nil gist to index")
}
primaryKey := "GistID"
_, err := (*atomicIndexer.Load()).(*MeiliIndexer).index.AddDocuments(gist, &primaryKey)
_, err := (*atomicIndexer.Load()).(*MeiliIndexer).index.AddDocuments(gist, &meilisearch.DocumentOptions{PrimaryKey: &primaryKey})
return err
}
func (i *MeiliIndexer) Remove(gistID uint) error {
_, err := (*atomicIndexer.Load()).(*MeiliIndexer).index.DeleteDocument(strconv.Itoa(int(gistID)))
_, err := (*atomicIndexer.Load()).(*MeiliIndexer).index.DeleteDocument(strconv.Itoa(int(gistID)), nil)
return err
}