Compare commits

..

1 Commits

Author SHA1 Message Date
namhq1989 b8d9d6d5a6 add method UpdateDocuments 2022-11-15 09:57:02 +07:00
1 changed files with 16 additions and 0 deletions

View File

@ -18,6 +18,22 @@ func (i *Index) AddDocuments(docs interface{}) error {
return err
}
func (i *Index) UpdateDocuments(docs interface{}) error {
_, err := getIndex(i.Name).UpdateDocuments(docs)
if err != nil {
logger.Error("update documents", logger.LogData{
Source: "meilisearch.index.UpdateDocuments",
Message: err.Error(),
Data: logger.Map{
"index": i,
"docs": docs,
},
})
}
return err
}
func (i *Index) DeleteDocumentsByPrimaryKeys(keys []string) error {
_, err := getIndex(i.Name).DeleteDocuments(keys)
if err != nil {