diff options
author | Tom N Harris <tnharris@whoopdedo.org> | 2007-09-19 21:42:44 +0200 |
---|---|---|
committer | Tom N Harris <tnharris@whoopdedo.org> | 2007-09-19 21:42:44 +0200 |
commit | a0c5c34961149cd101a49729d5dc0b73ed8ae2a5 (patch) | |
tree | 0b0e2a1311cfd50ffb74ee033a17718181baf5a8 /bin/indexer.php | |
parent | 11d9dfa5f39e8005a998d25bca1885847c2cb561 (diff) | |
download | dokuwiki-a0c5c34961149cd101a49729d5dc0b73ed8ae2a5.tar.gz dokuwiki-a0c5c34961149cd101a49729d5dc0b73ed8ae2a5.zip |
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/indexer.php')
-rwxr-xr-x | bin/indexer.php | 10 |
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()); |