code: func (s *BulkProcessorService) Do(ctx context.Context) (*BulkProcessor, error) {
  
  	retryItemStatusCodes := make(map[int]struct{})
  	for _, code := range s.retryItemStatusCodes {
  		retryItemStatusCodes[code] = struct{}{}
  	}
  
  	p := newBulkProcessor(
  		s.c,
  		s.beforeFn,
  		s.afterFn,
  		s.name,
  		s.numWorkers,
  		s.bulkActions,
  		s.bulkSize,
  		s.flushInterval,
  		s.wantStats,
  		s.backoff,
  		retryItemStatusCodes)
  
  	err := p.Start(ctx)
  	if err != nil {
  		return nil, err
  	}
  	return p, nil
  }
docs: // Do creates a new BulkProcessor and starts it.
  // Consider the BulkProcessor as a running instance that accepts bulk requests
  // and commits them to Elasticsearch, spreading the work across one or more
  // workers.
  //
  // You can interoperate with the BulkProcessor returned by Do, e.g. Start and
  // Stop (or Close) it.
  //
  // Context is an optional context that is passed into the bulk request
  // service calls. In contrast to other operations, this context is used in
  // a long running process. You could use it to pass e.g. loggers, but you
  // shouldn't use it for cancellation.
  //
  // Calling Do several times returns new BulkProcessors. You probably don't
  // want to do this. BulkProcessorService implements just a builder pattern.