Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 952db979e0
Fetching contributors…

Cannot retrieve contributors at this time

79 lines (72 sloc) 2.47 kb
<?php
// $Id: apachesolr_search.install,v 1.1.2.5.2.2 2009/12/01 14:05:21 robertDouglass Exp $
/**
* @file
* Install and related hooks for apachesolr_search.
*/
/**
* Implementation of hook_uninstall().
* Update to namespace tracking.
*/
function apachesolr_search_uninstall() {
$stored = variable_get('apachesolr_index_last', array());
unset($stored['apachesolr_search']);
variable_set('apachesolr_index_last', $stored);
}
/**
* Update to namespace tracking.
*/
function apachesolr_search_update_6000() {
$change = variable_get('apachesolr_search_last_change', 0);
$nid = variable_get('apachesolr_search_last_nid', 0);
if ($change || $nid) {
$stored = variable_get('apachesolr_index_last', array());
$stored['apachesolr_search'] = array('last_change' => $change, 'last_nid' => $nid);
variable_set('apachesolr_index_last', $stored);
}
variable_del('apachesolr_search_last_change');
variable_del('apachesolr_search_last_nid');
return array();
}
/**
* Update to block deltas.
*/
function apachesolr_search_update_6001() {
$ret = array();
if ($fields = apachesolr_cck_fields()) {
foreach ($fields as $name => $field) {
$index_key = substr(apachesolr_index_key($field), 0, 32);
$new_delta = $field['field_name'];
$ret[] = update_sql("UPDATE {blocks} SET delta = '". $new_delta ."' WHERE module = 'apachesolr_search' AND delta = '". $index_key ."'");
$ret[] = update_sql("UPDATE {blocks_roles} SET delta = '". $new_delta ."' WHERE module = 'apachesolr_search' AND delta = '". $index_key ."'");
}
}
return $ret;
}
/**
* Update mis-named variables.
*/
function apachesolr_search_update_6002() {
$ret = array();
$date_settings = variable_get('apacehsolr_search_date_boost', '');
$comment_settings = variable_get('apacehsolr_search_comment_boost', '');
if ($date_settings) {
variable_set('apachesolr_search_date_boost', $date_settings);
}
if ($comment_settings) {
variable_set('apachesolr_search_comment_boost', $comment_settings);
}
variable_del('apacehsolr_search_date_boost');
variable_del('apacehsolr_search_comment_boost');
return $ret;
}
/**
* Enable facet missing for books.
*/
function apachesolr_search_update_6003() {
$ret = array();
$facet_missing = variable_get('apachesolr_facet_missing', array());
$facet_missing['apachesolr_search']['is_book_bid'] = 1;
variable_set('apachesolr_facet_missing', $facet_missing);
return $ret;
}
Jump to Line
Something went wrong with that request. Please try again.