add method UpdateDocuments
This commit is contained in:
parent
e13e828f3c
commit
b8d9d6d5a6
16
document.go
16
document.go
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue