mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-01 14:37:20 +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');
|
require_once('LetoDMS/Lucene.php');
|
||||||
|
|
||||||
$index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir);
|
$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];
|
$hit = $hits[0];
|
||||||
$index->delete($hit->id);
|
$index->delete($hit->id);
|
||||||
$index->commit();
|
$index->commit();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user