MCPcopy Create free account
hub / github.com/apache/answer-plugins / UpdateContent

Method UpdateContent

search-meilisearch/meilisearch.go:139–155  ·  view source on GitHub ↗
(_ context.Context, content *plugin.SearchContent)

Source from the content-addressed store, hash-verified

137}
138
139func (s *Search) UpdateContent(_ context.Context, content *plugin.SearchContent) error {
140 if s.Client == nil {
141 return configuredErr
142 }
143
144 index := s.Client.Index(s.Config.IndexName)
145 if s.Config.Async {
146 _, err := index.AddDocuments([]*plugin.SearchContent{content}, primaryKey)
147 return err
148 } else {
149 resp, err := index.AddDocuments([]*plugin.SearchContent{content}, primaryKey)
150 if err != nil {
151 return err
152 }
153 return waitForTask(s.Client, resp)
154 }
155}
156
157func (s *Search) DeleteContent(_ context.Context, contentID string) error {
158 if s.Client == nil {

Callers

nothing calls this directly

Calls 1

waitForTaskFunction · 0.85

Tested by

no test coverage detected