mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-18 15:41:42 +00:00
- do some checks if document has version
This commit is contained in:
parent
1b5017cf38
commit
7a65e47cb5
|
@ -39,11 +39,13 @@ class LetoDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
|
||||||
if($convcmd) {
|
if($convcmd) {
|
||||||
$_convcmd = $convcmd;
|
$_convcmd = $convcmd;
|
||||||
}
|
}
|
||||||
Zend_Search_Lucene_Analysis_Analyzer::setDefault(new Zend_Search_Lucene_Analysis_Analyzer_Common_Utf8_CaseInsensitive());
|
|
||||||
$version = $document->getLatestContent();
|
$version = $document->getLatestContent();
|
||||||
$this->addField(Zend_Search_Lucene_Field::Keyword('document_id', $document->getID()));
|
$this->addField(Zend_Search_Lucene_Field::Keyword('document_id', $document->getID()));
|
||||||
|
if($version) {
|
||||||
$this->addField(Zend_Search_Lucene_Field::Keyword('mimetype', $version->getMimeType()));
|
$this->addField(Zend_Search_Lucene_Field::Keyword('mimetype', $version->getMimeType()));
|
||||||
$this->addField(Zend_Search_Lucene_Field::UnIndexed('created', $version->getDate()));
|
$this->addField(Zend_Search_Lucene_Field::UnIndexed('created', $version->getDate()));
|
||||||
|
}
|
||||||
$this->addField(Zend_Search_Lucene_Field::Text('title', $document->getName()));
|
$this->addField(Zend_Search_Lucene_Field::Text('title', $document->getName()));
|
||||||
if($categories = $document->getCategories()) {
|
if($categories = $document->getCategories()) {
|
||||||
$names = array();
|
$names = array();
|
||||||
|
@ -60,6 +62,7 @@ class LetoDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
|
||||||
if($comment = $document->getComment()) {
|
if($comment = $document->getComment()) {
|
||||||
$this->addField(Zend_Search_Lucene_Field::Text('comment', $comment));
|
$this->addField(Zend_Search_Lucene_Field::Text('comment', $comment));
|
||||||
}
|
}
|
||||||
|
if($version) {
|
||||||
$path = $dms->contentDir . $version->getPath();
|
$path = $dms->contentDir . $version->getPath();
|
||||||
$content = '';
|
$content = '';
|
||||||
$fp = null;
|
$fp = null;
|
||||||
|
@ -79,5 +82,6 @@ class LetoDMS_Lucene_IndexedDocument extends Zend_Search_Lucene_Document {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user