You are here

function search_by_page_force_reindex in Search by Page 6

Same name and namespace in other branches
  1. 8 search_by_page.module \search_by_page_force_reindex()
  2. 7 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.

5 calls to search_by_page_force_reindex()
sbp_attach_nodeapi in ./sbp_attach.module
Implementation of hook_nodeapi().
sbp_nodes_comment in ./sbp_nodes.module
Implementation of hook_comment().
sbp_nodes_nodeapi in ./sbp_nodes.module
Implementation of hook_nodeapi().
sbp_paths_edit_form_submit in ./sbp_paths.module
Submit callback for sbp_paths_edit_form().
sbp_users_user in ./sbp_users.module
Implements hook_user().

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);
    }
  }
}