(_ context.Context, content *plugin.SearchContent)
| 137 | } |
| 138 | |
| 139 | func (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 | |
| 157 | func (s *Search) DeleteContent(_ context.Context, contentID string) error { |
| 158 | if s.Client == nil { |
nothing calls this directly
no test coverage detected