public function performFlushFinishedCallback($success, array $results, $operations) {
    // The 'success' parameter means no fatal PHP errors were detected. All
    // other error management should be handled using 'results'.
    if ($success) {
      $message = \Drupal::translation()->formatPlural(
        count($results),
        'One profile flushed.', '@count profiles flushed.'
      );

      $indexes = Index::loadMultiple(['social_all', 'social_users']);
      /** @var \Drupal\search_api\Entity\Index $index */
      foreach ($indexes as $index) {
        // If the search index is on and items are not indexed immediately, the
        // index also needs to be flushed and re-indexed.
        if ($index !== NULL && $index->status() && !$index->getOption('index_directly')) {
          $index->clear();
          $index->reindex();
        }
      }
    }
    else {
      $message = t('Whoops... something went wrong!');
    }

    drupal_set_message($message);
  }