You are here

function _social_index_demo_content in Open Social 10.2.x

Same name and namespace in other branches
  1. 8.9 social.profile \_social_index_demo_content()
  2. 8.8 social.profile \_social_index_demo_content()
  3. 10.3.x social.profile \_social_index_demo_content()
  4. 10.0.x social.profile \_social_index_demo_content()
  5. 10.1.x social.profile \_social_index_demo_content()

Implements callback_batch_operation().

Performs a Search API re-indexing now the demo content is present.

1 string reference to '_social_index_demo_content'
social_install_demo_content in ./social.profile
Uses the Social Demo module to install demo content.

File

./social.profile, line 206
Enables modules and site configuration for a social site installation.

Code

function _social_index_demo_content(&$context) {
  $indexes = Index::loadMultiple();

  /** @var \Drupal\search_api\Entity\Index $index */
  foreach ($indexes as $index) {
    $index
      ->reindex();
  }
  $context['results'][] = 'index_search';
  $context['message'] = t('Re-indexed search to include demo content.');
}