add method getDocument()

this way the access on the index can be identical to SQliteFTS
This commit is contained in:
Uwe Steinmann 2015-08-10 21:40:26 +02:00
parent 0363395b9f
commit ae6044bc77

View File

@ -42,6 +42,17 @@ class SeedDMS_Lucene_Search {
$this->version = '3.0.0';
} /* }}} */
/**
* Get document from index
*
* @param object $index lucene index
* @return object instance of SeedDMS_Lucene_Document of false
*/
function getDocument($id) { /* {{{ */
$hits = $this->index->find('document_id:'.$id);
return $hits ? $hits[0] : false;
} /* }}} */
/**
* Search in index
*