MCPcopy Index your code
hub / github.com/apache/answer-plugins / DeleteDoc

Method DeleteDoc

search-elasticsearch/es_operator.go:101–109  ·  view source on GitHub ↗
(ctx context.Context, indexName string, id string)

Source from the content-addressed store, hash-verified

99}
100
101func (op *Operator) DeleteDoc(ctx context.Context, indexName string, id string) (err error) {
102 log.Debugf("try to delete doc from index: %s, %s", indexName, id)
103 _, err = op.C.Delete().Index(indexName).Id(id).Refresh("false").Do(ctx)
104 if err != nil {
105 log.Errorf("delete doc from index %s failed: %s", indexName, err.Error())
106 return err
107 }
108 return nil
109}

Callers 1

DeleteContentMethod · 0.80

Calls 1

DoMethod · 0.80

Tested by

no test coverage detected