Last active
June 27, 2017 22:58
-
-
Save kerasai/32cc589dcc18b1f5e35b8c7754f6d702 to your computer and use it in GitHub Desktop.
Drupal 8, populates the Search API queue for indexing all entities. Needed in cases where the entity does not populate the index queue on its own.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$index = \Drupal\search_api\Entity\Index::load('index_name'); | |
foreach ($index->getDatasources() as $id => $datasource) { | |
$index->trackItemsInserted($id, $datasource->getItemIds()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment