summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2010-10-18 22:03:03 +0200
committerAndreas Gohr <andi@splitbrain.org>2010-10-18 22:03:03 +0200
commit74afac00b33f004aad776496f113476acca8efc5 (patch)
tree151e2c63d89da1dc1bf21321ef1b6d3a808dc884
parentde4b4857b3a1ea36dbcdbd444a7d63cff93ad469 (diff)
downloadrpg-74afac00b33f004aad776496f113476acca8efc5.tar.gz
rpg-74afac00b33f004aad776496f113476acca8efc5.tar.bz2
removed deprecated index update function
-rwxr-xr-xbin/indexer.php7
-rw-r--r--inc/indexer.php45
-rw-r--r--lib/exe/indexer.php4
3 files changed, 0 insertions, 56 deletions
diff --git a/bin/indexer.php b/bin/indexer.php
index c95314d7c..48e98b571 100755
--- a/bin/indexer.php
+++ b/bin/indexer.php
@@ -71,13 +71,6 @@ 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('skipacl' => true));
diff --git a/inc/indexer.php b/inc/indexer.php
index 01ba76b08..f5330040a 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -701,49 +701,4 @@ function idx_tokenizer($string,&$stopwords,$wc=false){
return $words;
}
-/**
- * Create a pagewords index from the existing index.
- *
- * @author Tom N Harris <tnharris@whoopdedo.org>
- */
-function idx_upgradePageWords(){
- global $conf;
- $page_idx = idx_getIndex('page','');
- if (empty($page_idx)) return;
- $pagewords = array();
- $len = count($page_idx);
- for ($n=0;$n<$len;$n++){
- $pagewords[] = array();
- }
- unset($page_idx);
-
- $n=0;
- foreach (idx_indexLengths($n) as $wlen) {
- $lines = idx_getIndex('i',$wlen);
- $len = count($lines);
- for ($wid=0;$wid<$len;$wid++) {
- $wkey = "$wlen*$wid";
- foreach (explode(':',trim($lines[$wid])) as $part) {
- if($part == '') continue;
- list($doc,$cnt) = explode('*',$part);
- $pagewords[(int)$doc][] = $wkey;
- }
- }
- }
-
- $fn = $conf['indexdir'].'/pageword';
- $fh = @fopen($fn.'.tmp','w');
- if (!$fh){
- trigger_error("Failed to write word index", E_USER_ERROR);
- return false;
- }
- foreach ($pagewords as $line){
- fwrite($fh, join(':',$line)."\n");
- }
- fclose($fh);
- if($conf['fperm']) chmod($fn.'.tmp', $conf['fperm']);
- io_rename($fn.'.tmp', $fn.'.idx');
- return true;
-}
-
//Setup VIM: ex: et ts=4 enc=utf-8 :
diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php
index f8e2f7981..f9cc3158a 100644
--- a/lib/exe/indexer.php
+++ b/lib/exe/indexer.php
@@ -163,10 +163,6 @@ function runIndexer(){
}
if($conf['dperm']) chmod($lock, $conf['dperm']);
- // upgrade to version 2
- if (!@file_exists($conf['indexdir'].'/pageword.idx'))
- idx_upgradePageWords();
-
// do the work
idx_addPage($ID);