diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/exe/indexer.php | 18 | ||||
-rw-r--r-- | lib/plugins/config/lang/en/lang.php | 2 | ||||
-rw-r--r-- | lib/plugins/config/settings/config.metadata.php | 1 |
3 files changed, 16 insertions, 5 deletions
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index f5fc07bc3..057ab06f1 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -13,6 +13,9 @@ require_once(DOKU_INC.'inc/events.php'); session_write_close(); //close session if(!defined('NL')) define('NL',"\n"); +// Version tag used to force rebuild on upgrade +define(INDEXER_VERSION, 1); + // keep running after browser closes connection @ignore_user_abort(true); @@ -136,10 +139,15 @@ function runIndexer(){ if(!$ID) return false; // check if indexing needed - $last = @filemtime(metaFN($ID,'.indexed')); - if($last > @filemtime(wikiFN($ID))){ - print "runIndexer(): index for $ID up to date".NL; - return false; + $idxtag = metaFN($ID,'.indexed'); + if(@file_exists($idxtag)){ + if(io_readFile($idxtag) >= INDEXER_VERSION){ + $last = @filemtime($idxtag); + if($last > @filemtime(wikiFN($ID))){ + print "runIndexer(): index for $ID up to date".NL; + return false; + } + } } // try to aquire a lock @@ -163,7 +171,7 @@ function runIndexer(){ idx_addPage($ID); // we're finished - save and free lock - io_saveFile(metaFN($ID,'.indexed'),' '); + io_saveFile(metaFN($ID,'.indexed'),INDEXER_VERSION); @rmdir($lock); print "runIndexer(): finished".NL; return true; diff --git a/lib/plugins/config/lang/en/lang.php b/lib/plugins/config/lang/en/lang.php index 526ac4a0e..24b8db147 100644 --- a/lib/plugins/config/lang/en/lang.php +++ b/lib/plugins/config/lang/en/lang.php @@ -180,3 +180,5 @@ $lang['compression_o_0'] = 'none'; $lang['compression_o_gz'] = 'gzip'; $lang['compression_o_bz2'] = 'bz2'; +/* FIXME: delete when no longer needed */ +$lang['test_indexer'] = 'New Indexer testing bitfield: 0x1 -> sorted searching'; diff --git a/lib/plugins/config/settings/config.metadata.php b/lib/plugins/config/settings/config.metadata.php index 36b2be38b..44b121dfa 100644 --- a/lib/plugins/config/settings/config.metadata.php +++ b/lib/plugins/config/settings/config.metadata.php @@ -163,6 +163,7 @@ $meta['rss_type'] = array('multichoice','_choices' => array('rss','rss1','rss $meta['rss_linkto'] = array('multichoice','_choices' => array('diff','page','rev','current')); $meta['rss_update'] = array('numeric'); $meta['recent_days'] = array('numeric'); +$meta['test_indexer'] = array('numeric'); // FIXME: delete when no longer needed $meta['_network'] = array('fieldset'); $meta['proxy____host'] = array('string','_pattern' => '#^[a-z0-9\-\.+]+?#i'); |