| 1 |
<?php |
<?php |
| 2 |
// $Id: xapian.module,v 1.10.2.9 2009/04/01 13:12:42 jeremy Exp $ |
// $Id: xapian.module,v 1.10.2.10 2009/04/01 13:44:39 jeremy Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 836 |
if ($node) { |
if ($node) { |
| 837 |
if (in_array($node->type, $exclusions)) { |
if (in_array($node->type, $exclusions)) { |
| 838 |
// None indexable a node, log and clear it from the queue |
// None indexable a node, log and clear it from the queue |
|
watchdog('xapian', 'Node with id %node was excluded from indexing due to type', array('%node' => $node->nid)); |
|
| 839 |
xapian_remove_node_from_index($node); |
xapian_remove_node_from_index($node); |
| 840 |
db_query('DELETE FROM {xapian_index_queue} WHERE nid = %d', $node->nid); |
db_query('DELETE FROM {xapian_index_queue} WHERE nid = %d', $node->nid); |
| 841 |
$failed++; |
$failed++; |
| 896 |
function xapian_reindex_all_confirm_submit($form, &$form_state) { |
function xapian_reindex_all_confirm_submit($form, &$form_state) { |
| 897 |
if ($form_state['values']['confirm']) { |
if ($form_state['values']['confirm']) { |
| 898 |
db_query('TRUNCATE {xapian_index_queue}'); |
db_query('TRUNCATE {xapian_index_queue}'); |
| 899 |
db_query('INSERT INTO {xapian_index_queue} (nid, added) SELECT nid, UNIX_TIMESTAMP() FROM {node}'); |
$sql = 'INSERT INTO {xapian_index_queue} (nid, added) SELECT nid, UNIX_TIMESTAMP() FROM {node}'; |
| 900 |
|
$exclusions = array_values(variable_get('xapian_excluded_nodes', array())); |
| 901 |
|
if (!empty($exclusions)) { |
| 902 |
|
$sql .= " WHERE type NOT IN ('". implode("','", $exclusions) ."')"; |
| 903 |
|
} |
| 904 |
|
drupal_set_message("sql($sql)"); |
| 905 |
|
db_query($sql); |
| 906 |
drupal_set_message(t('The search index will be rebuilt.')); |
drupal_set_message(t('The search index will be rebuilt.')); |
| 907 |
$form_state['redirect'] = 'admin/settings/xapian'; |
$form_state['redirect'] = 'admin/settings/xapian'; |
| 908 |
} |
} |