| 1 |
<?php |
<?php |
| 2 |
// $Id: xapian.module,v 1.10.2.11 2009/04/01 14:00:31 jeremy Exp $ |
// $Id: xapian.module,v 1.10.2.12 2009/04/01 14:00:58 jeremy Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 749 |
function xapian_index_node(&$node) { |
function xapian_index_node(&$node) { |
| 750 |
$exclusions = array_values(variable_get('xapian_excluded_nodes', array())); |
$exclusions = array_values(variable_get('xapian_excluded_nodes', array())); |
| 751 |
if (in_array($node->type, $exclusions)) { |
if (in_array($node->type, $exclusions)) { |
| 752 |
|
xapian_remove_node_from_index($node); |
| 753 |
return; |
return; |
| 754 |
} |
} |
| 755 |
if (variable_get('xapian_index_immediately', TRUE)) { |
if (variable_get('xapian_index_immediately', TRUE)) { |
| 897 |
function xapian_reindex_all_confirm_submit($form, &$form_state) { |
function xapian_reindex_all_confirm_submit($form, &$form_state) { |
| 898 |
if ($form_state['values']['confirm']) { |
if ($form_state['values']['confirm']) { |
| 899 |
db_query('TRUNCATE {xapian_index_queue}'); |
db_query('TRUNCATE {xapian_index_queue}'); |
| 900 |
$sql = 'INSERT INTO {xapian_index_queue} (nid, added) SELECT nid, UNIX_TIMESTAMP() FROM {node}'; |
db_query('INSERT INTO {xapian_index_queue} (nid, added) SELECT nid, UNIX_TIMESTAMP() FROM {node}'); |
|
$exclusions = array_values(variable_get('xapian_excluded_nodes', array())); |
|
|
if (!empty($exclusions)) { |
|
|
$sql .= " WHERE type NOT IN ('". implode("','", $exclusions) ."')"; |
|
|
} |
|
|
db_query($sql); |
|
| 901 |
drupal_set_message(t('The search index will be rebuilt.')); |
drupal_set_message(t('The search index will be rebuilt.')); |
| 902 |
$form_state['redirect'] = 'admin/settings/xapian'; |
$form_state['redirect'] = 'admin/settings/xapian'; |
| 903 |
} |
} |