code: def run(delayed, concurrency, version_type=None, queue=None,
          raise_on_error=True):
      
      if delayed:
          celery_kwargs = {
              'kwargs': {
                  'version_type': version_type,
                  'es_bulk_kwargs': {'raise_on_error': raise_on_error},
              }
          }
          click.secho(
              'Starting {0} tasks for indexing records...'.format(concurrency),
              fg='green')
          if queue is not None:
              celery_kwargs.update({'queue': queue})
          for c in range(0, concurrency):
              process_bulk_queue.apply_async(**celery_kwargs)
      else:
          click.secho('Indexing records...', fg='green')
          RecordIndexer(version_type=version_type).process_bulk_queue(
              es_bulk_kwargs={'raise_on_error': raise_on_error})
docs: Run bulk record indexing.