summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorTom N Harris <tnharris@whoopdedo.org>2007-09-19 21:42:44 +0200
committerTom N Harris <tnharris@whoopdedo.org>2007-09-19 21:42:44 +0200
commita0c5c34961149cd101a49729d5dc0b73ed8ae2a5 (patch)
tree0b0e2a1311cfd50ffb74ee033a17718181baf5a8 /bin
parent11d9dfa5f39e8005a998d25bca1885847c2cb561 (diff)
downloadrpg-a0c5c34961149cd101a49729d5dc0b73ed8ae2a5.tar.gz
rpg-a0c5c34961149cd101a49729d5dc0b73ed8ae2a5.tar.bz2
Remove obsolete words from search index
Creates another index file 'pagewords.idx' for the words in each page. Words that are deleted from a page can then be removed from the word index. The indexer version is incremented to force rebuilding of the index. Also, a minor flaw in the regexp for asian words is fixed. darcs-hash:20070919194244-6942e-2e08157dcf4fdf166b35b36a0faf8a3dfb415ad9.gz
Diffstat (limited to 'bin')
-rwxr-xr-xbin/indexer.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/indexer.php b/bin/indexer.php
index d5f4c6446..c62f97882 100755
--- a/bin/indexer.php
+++ b/bin/indexer.php
@@ -13,7 +13,7 @@ session_write_close();
// Version tag used to force rebuild on upgrade
// Need to keep in sync with lib/exe/indexer.php
-if(!defined('INDEXER_VERSION')) define('INDEXER_VERSION', 1);
+if(!defined('INDEXER_VERSION')) define('INDEXER_VERSION', 2);
// handle options
$short_opts = 'hcuq';
@@ -68,6 +68,14 @@ function _usage() {
function _update(){
global $conf;
+
+ // upgrade to version 2
+ if (!@file_exists($conf['indexdir'].'/pageword.idx')){
+ _lock();
+ idx_upgradePageWords();
+ _unlock();
+ }
+
$data = array();
_quietecho("Searching pages... ");
search($data,$conf['datadir'],'search_allpages',array());