summaryrefslogtreecommitdiff
path: root/inc/indexer.php
diff options
context:
space:
mode:
authorHakan Sandell <sandell.hakan@gmail.com>2010-10-23 16:40:40 +0200
committerHakan Sandell <sandell.hakan@gmail.com>2010-10-23 16:40:40 +0200
commitbcb79ff3b3b63c74a93cdf4762fa0cd1bb28d17a (patch)
treeadcea7789395cf752416306f0ed6952c7f702ef8 /inc/indexer.php
parente3626db54846ba20cefbc1a9e2d8e29c40137067 (diff)
parent06ce34e4a80b6875db82190eb7abfb97bfd801b8 (diff)
downloadrpg-bcb79ff3b3b63c74a93cdf4762fa0cd1bb28d17a.tar.gz
rpg-bcb79ff3b3b63c74a93cdf4762fa0cd1bb28d17a.tar.bz2
Merge branch 'master' of git://github.com/splitbrain/dokuwiki
Diffstat (limited to 'inc/indexer.php')
-rw-r--r--inc/indexer.php45
1 files changed, 0 insertions, 45 deletions
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 :