You are here

function panopoly_search_update_7005 in Panopoly Search 7

Make sure search is configured to index Panelizer and reindex all nodes.

File

./panopoly_search.install, line 133
Installation file for Panopoly Search

Code

function panopoly_search_update_7005() {
  if (module_exists('panopoly_search')) {
    features_revert(array(
      'panopoly_search' => array(
        'search_api_server',
        'search_api_index',
      ),
    ));
    $types = array();
    foreach (search_api_index_load_multiple(array(
      'database_node_index',
      'node_index',
    )) as $index) {
      if ($index->enabled) {
        $types[$index->item_type][] = $index;
      }
    }
    foreach ($types as $type => $indexes) {
      try {
        $controller = search_api_get_datasource_controller($type);
        $controller
          ->startTracking($indexes);
      } catch (SearchApiException $e) {
        watchdog_exception('panopoly_search', $e);
      }
    }
  }
}