MCPcopy
hub / github.com/elastic/go-elasticsearch / Add

Method Add

esutil/bulk_indexer.go:53–53  ·  view source on GitHub ↗

Add adds an item to the indexer. It returns an error when the item cannot be added. Use the OnSuccess and OnFailure callbacks to get the operation result for the item. You must call the Close() method after you're done adding items. It is safe for concurrent use. When it's called from goroutines,

(context.Context, BulkIndexerItem)

Source from the content-addressed store, hash-verified

51 // It is safe for concurrent use. When it's called from goroutines,
52 // they must finish before the call to Close, eg. using sync.WaitGroup.
53 Add(context.Context, BulkIndexerItem) error
54
55 // Close waits until all added items are flushed and closes the indexer.
56 Close(context.Context) error

Callers 15

mainFunction · 0.95
runMethod · 0.95
initFunction · 0.95
TestBulkIndexerFunction · 0.95
TestBulkIndexerFlushFunction · 0.95
BenchmarkBulkIndexerFunction · 0.95
ExampleNewBulkIndexerFunction · 0.95
ExampleBulkIndexer_FlushFunction · 0.95

Implementers 1

bulkIndexeresutil/bulk_indexer.go

Calls

no outgoing calls

Tested by 15

TestBulkIndexerFunction · 0.76
TestBulkIndexerFlushFunction · 0.76
BenchmarkBulkIndexerFunction · 0.76
ExampleNewBulkIndexerFunction · 0.76
ExampleBulkIndexer_FlushFunction · 0.76
TestFingerprintFunction · 0.52
TestInstrumentationFunction · 0.52
TestInterceptsFunction · 0.52