From a0c5c34961149cd101a49729d5dc0b73ed8ae2a5 Mon Sep 17 00:00:00 2001 From: Tom N Harris Date: Wed, 19 Sep 2007 21:42:44 +0200 Subject: 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 --- bin/indexer.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'bin') 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()); -- cgit v1.2.3