You are here

function search_by_page_force_reindex in Search by Page 7

Same name and namespace in other branches
  1. 8 search_by_page.module \search_by_page_force_reindex()
  2. 6 search_by_page.module \search_by_page_force_reindex()

Forces a page to be reindexed at the next cron run.

Parameters

$module: Module that submitted this path for indexing.

$id: ID given in hook_sbp_paths() for this path.

$environment: Environment ID where this path should be reindexed. If omitted, all environments are checked.

9 calls to search_by_page_force_reindex()
sbp_attach_node_update in ./sbp_attach.module
Implements hook_node_update().
sbp_nodes_comment_delete in ./sbp_nodes.module
Implements hook_comment_delete().
sbp_nodes_comment_insert in ./sbp_nodes.module
Implements hook_comment_insert().
sbp_nodes_comment_publish in ./sbp_nodes.module
Implements hook_comment_publish().
sbp_nodes_comment_unpublish in ./sbp_nodes.module
Implements hook_comment_unpublish().

... See full list

File

./search_by_page.module, line 32
Main module file for Drupal module Search by Page.

Code

function search_by_page_force_reindex($module, $id, $environment = NULL) {
  $envs = array();
  if (isset($environment)) {
    $envs = array(
      $environment,
    );
  }
  else {
    $envs = search_by_page_list_environments();
  }
  foreach ($envs as $env) {
    $item = _search_by_page_lookup(0, '', $id, $module, $env);
    if ($item) {
      _search_by_page_update_last_time($item->pid, 0);
    }
  }
}