public function SocialDrupalContext::updateSearchIndexes in Open Social 10.0.x
Same name and namespace in other branches
- 8.9 tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::updateSearchIndexes()
- 8.5 tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::updateSearchIndexes()
- 8.6 tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::updateSearchIndexes()
- 8.7 tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::updateSearchIndexes()
- 8.8 tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::updateSearchIndexes()
- 10.3.x tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::updateSearchIndexes()
- 10.1.x tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::updateSearchIndexes()
- 10.2.x tests/behat/features/bootstrap/SocialDrupalContext.php \Drupal\social\Behat\SocialDrupalContext::updateSearchIndexes()
@Given Search indexes are up to date
File
- tests/
behat/ features/ bootstrap/ SocialDrupalContext.php, line 221
Class
- SocialDrupalContext
- Provides pre-built step definitions for interacting with Open Social.
Namespace
Drupal\social\BehatCode
public function updateSearchIndexes() {
/** @var \Drupal\search_api\Entity\SearchApiConfigEntityStorage $index_storage */
$index_storage = \Drupal::service("entity_type.manager")
->getStorage('search_api_index');
$indexes = $index_storage
->loadMultiple();
if (!$indexes) {
return;
}
// Loop over all interfaces and let the Search API index any non-indexed
// items.
foreach ($indexes as $index) {
/** @var \Drupal\search_api\IndexInterface $index */
$index
->indexItems();
}
}