Skip to content
Snippets Groups Projects
Commit 4b938509 authored by Michael Hamann's avatar Michael Hamann
Browse files

Properly clean up the whole index in bin/indexer.php

There were some index files that haven't been cleaned up, now also the
files of the metadata index are cleaned/removed when a clean is
requested.
parent 571b9b92
No related branches found
No related tags found
No related merge requests found
......@@ -133,12 +133,15 @@ function _clearindex(){
_lock();
_quietecho("Clearing index... ");
io_saveFile($conf['indexdir'].'/page.idx','');
//io_saveFile($conf['indexdir'].'/title.idx','');
io_saveFile($conf['indexdir'].'/title.idx','');
io_saveFile($conf['indexdir'].'/pageword.idx','');
io_saveFile($conf['indexdir'].'/metadata.idx','');
$dir = @opendir($conf['indexdir']);
if($dir!==false){
while(($f = readdir($dir)) !== false){
if(substr($f,-4)=='.idx' &&
(substr($f,0,1)=='i' || substr($f,0,1)=='w'))
(substr($f,0,1)=='i' || substr($f,0,1)=='w'
|| substr($f,-6)=='_w.idx' || substr($f,-6)=='_i.idx' || substr($f,-6)=='_p.idx'))
@unlink($conf['indexdir']."/$f");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment