You are here

function search_by_page_force_reindex in Search by Page 8

Same name and namespace in other branches
  1. 6 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_search_by_page_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()
search_by_page_attach_node_update in search_by_page_attach/search_by_page_attach.module
Implements hook_node_update().
search_by_page_nodes_comment_delete in search_by_page_nodes/search_by_page_nodes.module
Implements hook_comment_delete().
search_by_page_nodes_comment_insert in search_by_page_nodes/search_by_page_nodes.module
Implements hook_comment_insert().
search_by_page_nodes_comment_publish in search_by_page_nodes/search_by_page_nodes.module
Implements hook_comment_publish().
search_by_page_nodes_comment_unpublish in search_by_page_nodes/search_by_page_nodes.module
Implements hook_comment_unpublish().

... See full list

File

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

Code

function search_by_page_force_reindex($module, $id, $environment = NULL) {
  $envs = [];
  if (isset($environment)) {
    $envs = [
      $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);
    }
  }
}