apachesolr_og.install in Apache Solr Search 6
Same filename and directory in other branches
Install and related hooks for the apachesolr_date module.
File
contrib/apachesolr_og/apachesolr_og.installView source
<?php
/**
 * @file
 *   Install and related hooks for the apachesolr_date module.
 */
/**
 * Implementation of hook_uninstall().
 */
function apachesolr_og_uninstall() {
  // Remove blocks.
  db_query('DELETE FROM {blocks} WHERE module = "apachesolr_og"');
}
/**
 * Implementation of hook_enable().
 */
function apachesolr_og_enable() {
  $facet_missing = variable_get('apachesolr_facet_missing', array());
  $facet_missing['apachesolr_og']['im_og_gid'] = 1;
  variable_set('apachesolr_facet_missing', $facet_missing);
  drupal_set_message(t('All existing Organic Group posts will be re-indexed'), 'warning');
  db_query("UPDATE {apachesolr_search_node} SET changed = %d WHERE nid IN (SELECT nid FROM {og_ancestry})", time());
}
/**
 * Implementation of hook_disable().
 */
function apachesolr_og_disable() {
  // Disable all facets for this module.
  apachesolr_save_module_facets('apachesolr_og', array());
}
/**
 * Re-index so as to use new missing field query.
 */
function apachesolr_og_update_6000() {
  $ret = array();
  apachesolr_clear_last_index();
  $ret[] = array(
    'success' => TRUE,
    'query' => 'Called function apachesolr_clear_last_index(). All content will be re-indexed',
  );
  $facet_missing = variable_get('apachesolr_facet_missing', array());
  $facet_missing['apachesolr_og'][_apachesolr_og_gid_key()] = 1;
  variable_set('apachesolr_facet_missing', $facet_missing);
  return $ret;
}Functions
| Name   | Description | 
|---|---|
| apachesolr_og_disable | Implementation of hook_disable(). | 
| apachesolr_og_enable | Implementation of hook_enable(). | 
| apachesolr_og_uninstall | Implementation of hook_uninstall(). | 
| apachesolr_og_update_6000 | Re-index so as to use new missing field query. | 
