mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-30 21:47:30 +00:00
check if index exists before indexing a new document
This commit is contained in:
parent
11499ca484
commit
2b4a96e8f5
|
@ -60,7 +60,7 @@ if (!$document->remove()) {
|
|||
require_once('LetoDMS/Lucene.php');
|
||||
|
||||
$index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir);
|
||||
if($hits = $index->find('document_id:'.$documentid)) {
|
||||
if($index && $hits = $index->find('document_id:'.$documentid)) {
|
||||
$hit = $hits[0];
|
||||
$index->delete($hit->id);
|
||||
$index->commit();
|
||||
|
|
Loading…
Reference in New Issue
Block a user