use findById instead of find in getDocument() and getFolder()

This commit is contained in:
Uwe Steinmann 2021-06-24 11:38:04 +02:00
parent ec46d40194
commit 50e8c84932

View File

@ -45,23 +45,23 @@ class SeedDMS_SQliteFTS_Search {
/**
* Get document from index
*
* @param int $id real document id
* @param int $id id of seeddms document
* @return object instance of SeedDMS_SQliteFTS_QueryHit or false
*/
function getDocument($id) { /* {{{ */
$hits = $this->index->find('D'.$id);
return $hits['hits'] ? $hits['hits'][0] : false;
$hits = $this->index->findById('D'.$id);
return $hits ? $hits[0] : false;
} /* }}} */
/**
* Get folder from index
*
* @param int $id real folder id
* @param int $id id of seeddms folder
* @return object instance of SeedDMS_SQliteFTS_QueryHit or false
*/
function getFolder($id) { /* {{{ */
$hits = $this->index->find('F'.$id);
return $hits['hits'] ? $hits['hits'][0] : false;
$hits = $this->index->findById('F'.$id);
return $hits ? $hits[0] : false;
} /* }}} */
/**