You are here

function apachesolr_clear_last_index_position in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_clear_last_index_position()
  2. 6.3 apachesolr.module \apachesolr_clear_last_index_position()

Clear a specific environment, or clear all.

2 calls to apachesolr_clear_last_index_position()
apachesolr_access_rebuild_nodeaccess in apachesolr_access/apachesolr_access.module
Force Solr to do a total re-index when node access rules change.
apachesolr_index_mark_for_reindex in ./apachesolr.index.inc
Mark a certain entity type for a specific environment for reindexing.

File

./apachesolr.module, line 900
Integration with the Apache Solr search application.

Code

function apachesolr_clear_last_index_position($env_id = NULL, $entity_type = NULL) {
  if (!empty($env_id)) {
    $stored = apachesolr_environment_variable_get($env_id, 'apachesolr_index_last', array());
    if ($entity_type) {
      unset($stored[$entity_type]);
    }
    else {
      $stored = array();
    }
    apachesolr_environment_variable_set($env_id, 'apachesolr_index_last', $stored);
  }
  else {
    $environments = apachesolr_load_all_environments();
    foreach (array_keys($environments) as $env_id) {
      apachesolr_environment_variable_set($env_id, 'apachesolr_index_last', array());
    }
  }
}