summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xbin/indexer.php10
-rw-r--r--inc/indexer.php5
2 files changed, 4 insertions, 11 deletions
diff --git a/bin/indexer.php b/bin/indexer.php
index 6ee0a9e8d..4bfd1682e 100755
--- a/bin/indexer.php
+++ b/bin/indexer.php
@@ -86,16 +86,8 @@ function _index($id){
global $CLEAR;
global $QUIET;
- // if not cleared only update changed and new files
- if($CLEAR){
- $idxtag = metaFN($id,'.indexed');
- if(@file_exists($idxtag)){
- @unlink($idxtag);
- }
- }
-
_quietecho("$id... ");
- idx_addPage($id, !$QUIET);
+ idx_addPage($id, !$QUIET, $CLEAR);
_quietecho("done.\n");
}
diff --git a/inc/indexer.php b/inc/indexer.php
index 03008cd71..107845e24 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -1166,13 +1166,14 @@ function & idx_get_stopwords() {
*
* @param string $page name of the page to index
* @param boolean $verbose print status messages
+ * @param boolean $force force reindexing even when the index is up to date
* @return boolean the function completed successfully
* @author Tom N Harris <tnharris@whoopdedo.org>
*/
-function idx_addPage($page, $verbose=false) {
+function idx_addPage($page, $verbose=false, $force=false) {
// check if indexing needed
$idxtag = metaFN($page,'.indexed');
- if(@file_exists($idxtag)){
+ if(!$force && @file_exists($idxtag)){
if(trim(io_readFile($idxtag)) == idx_get_version()){
$last = @filemtime($idxtag);
if($last > @filemtime(wikiFN($page))){