$action = "idx"; $file = ''; $p = dirname($p); } else { $output[] = "Impossible d'archiver $p"; } } else { $output[] = "$p n'existe pas."; } } if (($action == "idx") or ($postaction == "idx")) { if (@is_dir($cf_datadir.$p)) { $rebuilt = rebuild_index($p); } else { $rebuilt = rebuild_index(dirname($p)); } $output[] = ".idx $p reconstruit."; } if ($p and ($action == "dit")) { $locked = lockfile("$p"); $output[] = "Fichier $p en mode edition."; } elseif ($p and ($action == "dix")) { $locked = lockfile("$p"); $output[] = "Fichier $p en mode edition brute."; } elseif ($action == "ulk") { unlockfile("$p"); $output[] = "Fichier $p dévérouillé."; } elseif ($action == "lok") { lockfile("$p");
$unindexedOnly = true; // only index content that hasn't been indexed yet break; default: $whatToIndex = $arg; break; } } $time_start = microtime_float(); if (!$silent) { echo "\nBeginning Reindex of {$whatToIndex} ...\n"; } if (!$silent && $unindexedOnly) { echo "Warning: unindexed only flag set. Will break MySQL 3.x because of sub-selects\n"; } $count = rebuild_index($whatToIndex, $unindexedOnly); $time_end = microtime_float(); $time = number_format($time_end - $time_start, 4); if (!$silent) { echo "Index rebuild complete.\n"; } if (!$silent) { echo "Attempted to index {$count} pieces of content\n"; } if (!$silent) { echo "(Note: Some content may not be indexable. This is normal)\n"; } if (!$silent) { echo "Execution time: {$time} seconds\n"; } die;
// $Header$ // Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al. // All Rights Reserved. See below for details and a complete list of authors. // Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details. $feedback = array(); $formSearchToggles = array('search_stats' => array('label' => 'Search Statistics', 'note' => 'Record searches made and their frequency.'), 'search_index_on_submit' => array('label' => 'Index On Submit', 'note' => 'Index articles, blogs and wiki pages immdiately on submission. If unchecked, pages will be updated randomly according the the refresh rate below.')); $formSearchInts = array('search_refresh_rate' => array('label' => 'Search Refresh Rate', 'note' => 'Varies the rate at which updates to the search index are made, 1 = every page read, while rate>1 will introduce a random chance of a refresh every "rate" pages'), 'search_min_wordlength' => array('label' => 'Minimum number of letters for search words', 'note' => 'By settings this value to 3, you can ignore search words such as "a" or "or", however searches for a number like "13" will be ignored as well.'), 'search_max_syllwords' => array('label' => 'Maximum number of words', 'note' => 'The maximum number of words containing a syllable that can be serached for in any one search.'), 'search_syll_age' => array('label' => 'Age in hours of search cache', 'note' => 'Define the Maximum age of cached search results for any given syllable. The results cache will be used to provide a search result if it is available, and will be cleared after either the age, or when the results cache reaches it\'s limit'), 'search_lru_purge_rate' => array('label' => 'Least Recently Used (LRU) list purging rate', 'note' => 'Purge the results cache every "rate" pages. This will keep space available in the cache for new search results'), 'search_lru_length' => array('label' => 'Least Recently Used (LRU) list length', 'note' => 'Limit the results cache to this number of entries')); if (!empty($_REQUEST['del_index'])) { require_once SEARCH_PKG_PATH . '/refresh_functions.php'; delete_index_content_type($_REQUEST["where"]); $feedback['success'] = tra("The search index was successfully deleted."); } if (!empty($_REQUEST['del_index_reindex'])) { require_once SEARCH_PKG_PATH . '/refresh_functions.php'; $count = rebuild_index($_REQUEST["where"]); $feedback['success'] = tra("The search index was successfully deleted.") . tra("Number of items re-indexed") . ": " . $count; } if (!empty($_REQUEST['del_searchwords'])) { require_once SEARCH_PKG_PATH . '/refresh_functions.php'; delete_search_words_and_syllables(); $feedback['success'] = tra("The searchwords were successfully purged from the database."); } if (!empty($_REQUEST['store_prefs'])) { foreach ($formSearchInts as $item => $data) { simple_set_int($item, SEARCH_PKG_NAME); $formSearchInts[$item]['value'] = $_REQUEST[$item]; } foreach ($formSearchToggles as $item => $data) { simple_set_toggle($item, SEARCH_PKG_NAME); }