mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
check if index and indexconf is set
This commit is contained in:
parent
072d203379
commit
bab648b988
|
@ -40,30 +40,31 @@ if(!$settings->_enableFullSearch) {
|
|||
UI::exitError(getMLText("admin_tools"),getMLText("fulltextsearch_disabled"));
|
||||
}
|
||||
|
||||
$index = null;
|
||||
if(!isset($_GET['action']) || $_GET['action'] == 'show') {
|
||||
if(isset($_GET['create']) && $_GET['create'] == 1) {
|
||||
if(isset($_GET['confirm']) && $_GET['confirm'] == 1) {
|
||||
$index = $indexconf['Indexer']::create($settings->_luceneDir);
|
||||
if($indexconf) {
|
||||
if(isset($_GET['create']) && $_GET['create'] == 1) {
|
||||
if(isset($_GET['confirm']) && $_GET['confirm'] == 1) {
|
||||
$index = $indexconf['Indexer']::create($settings->_luceneDir);
|
||||
if(!$index) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("no_fulltextindex"));
|
||||
}
|
||||
$indexconf['Indexer']::init($settings->_stopWordsFile);
|
||||
} else {
|
||||
header('Location: out.CreateIndex.php');
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$index = $indexconf['Indexer']::open($settings->_luceneDir);
|
||||
if(!$index) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("no_fulltextindex"));
|
||||
$index = $indexconf['Indexer']::create($settings->_luceneDir);
|
||||
if(!$index) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("no_fulltextindex"));
|
||||
}
|
||||
}
|
||||
$indexconf['Indexer']::init($settings->_stopWordsFile);
|
||||
} else {
|
||||
header('Location: out.CreateIndex.php');
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
$index = $indexconf['Indexer']::open($settings->_luceneDir);
|
||||
if(!$index) {
|
||||
$index = $indexconf['Indexer']::create($settings->_luceneDir);
|
||||
if(!$index) {
|
||||
UI::exitError(getMLText("admin_tools"),getMLText("no_fulltextindex"));
|
||||
}
|
||||
}
|
||||
$indexconf['Indexer']::init($settings->_stopWordsFile);
|
||||
}
|
||||
} else {
|
||||
$index = null;
|
||||
}
|
||||
|
||||
if (!isset($_GET["folderid"]) || !is_numeric($_GET["folderid"]) || intval($_GET["folderid"])<1) {
|
||||
|
|
|
@ -201,6 +201,7 @@ $(document).ready( function() {
|
|||
$this->contentStart();
|
||||
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
|
||||
$this->contentHeading(getMLText("update_fulltext_index"));
|
||||
if($index) {
|
||||
?>
|
||||
<style type="text/css">
|
||||
li {line-height: 20px;}
|
||||
|
@ -230,7 +231,9 @@ li {line-height: 20px;}
|
|||
|
||||
$index->commit();
|
||||
$index->optimize();
|
||||
|
||||
} else {
|
||||
$this->warningMsg(getMLText('fulltextsearch_disabled'));
|
||||
}
|
||||
$this->contentEnd();
|
||||
$this->htmlEndPage();
|
||||
} /* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user