MCPcopy Index your code
hub / github.com/devaccuracy/ledgerforge / DropCollection

Method DropCollection

internal/search/reindex.go:399–405  ·  view source on GitHub ↗

DropCollection deletes a collection from Typesense.

(ctx context.Context, collectionName string)

Source from the content-addressed store, hash-verified

397
398// DropCollection deletes a collection from Typesense.
399func (t *TypesenseClient) DropCollection(ctx context.Context, collectionName string) error {
400 _, err := t.Client.Collection(collectionName).Delete(ctx)
401 if err != nil && !strings.Contains(err.Error(), "not found") && !strings.Contains(err.Error(), "Not Found") {
402 return err
403 }
404 return nil
405}
406
407// DropAllCollections drops all known collections from Typesense.
408func (t *TypesenseClient) DropAllCollections(ctx context.Context) error {

Callers 1

DropAllCollectionsMethod · 0.95

Calls 2

DeleteMethod · 0.65
ErrorMethod · 0.45

Tested by

no test coverage detected