From 579b0f7e8d80287b11fd441dfa68d15e9d4bb74c Mon Sep 17 00:00:00 2001 From: TNHarris Date: Sun, 12 Nov 2006 20:49:00 +0100 Subject: Word-Length Indexer A modification to the indexer that sorts words based on length. This should make searching a little bit more efficient. After the patch is applied, your old index will be automatically converted to the new format (when you visit a page). The new index format is: 1. Index files are stored in savedir/index 2. Word lists are stored as wlen.idx. This used to be word.idx. 3. Word indexes are stored as ilen.idx. This used to be index.idx. 4. The page list, page.idx, is simply copied to the new location. Any plugins you have, such as the blog plugin, that read the index files need to be updated. darcs-hash:20061112194900-2b9f0-a975498ccf0a1d39c6df73b79bcd028d5e81c389.gz --- lib/exe/indexer.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/exe/indexer.php') diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php index 224c54311..12177406f 100644 --- a/lib/exe/indexer.php +++ b/lib/exe/indexer.php @@ -120,6 +120,18 @@ function runIndexer(){ global $conf; print "runIndexer(): started".NL; + // Move index files (if needed) + // Uses the importoldindex plugin to upgrade the index automatically. + // FIXME: Remove this from runIndexer when it is no longer needed. + if (@file_exists($conf['cachedir'].'/page.idx') && + (!@file_exists($conf['indexdir'].'/page.idx') || + !filesize($conf['indexdir'].'/page.idx')) && + !@file_exists($conf['indexdir'].'/index_importing')) { + echo "trigger TEMPORARY_INDEX_UPGRADE_EVENT\n"; + $tmp = array(); // no event data + trigger_event('TEMPORARY_INDEX_UPGRADE_EVENT', $tmp); + } + $ID = cleanID($_REQUEST['id']); if(!$ID) return false; @@ -233,7 +245,7 @@ function runSitemapper(){ return false; } - $pages = file($conf['cachedir'].'/page.idx'); + $pages = file($conf['indexdir'].'/page.idx'); print 'runSitemapper(): creating sitemap using '.count($pages).' pages'.NL; // build the sitemap -- cgit v1.2.3