mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 13:06:14 +00:00
throw exeption in find()
This commit is contained in:
parent
8e542b448f
commit
fe43b944c9
|
@ -190,7 +190,8 @@ class SeedDMS_SQLiteFTS_Indexer {
|
||||||
$sql .= " WHERE docs MATCH ".$this->_conn->quote($query);
|
$sql .= " WHERE docs MATCH ".$this->_conn->quote($query);
|
||||||
$res = $this->_conn->query($sql." GROUP BY `".$facetname."`");
|
$res = $this->_conn->query($sql." GROUP BY `".$facetname."`");
|
||||||
if(!$res)
|
if(!$res)
|
||||||
return false;
|
throw new SeedDMS_SQLiteFTS_Exception("Counting records in facet \"$facetname\" failed.");
|
||||||
|
// return false;
|
||||||
$facets[$facetname] = array();
|
$facets[$facetname] = array();
|
||||||
foreach($res as $row) {
|
foreach($res as $row) {
|
||||||
if($row[$facetname] && $row['c']) {
|
if($row[$facetname] && $row['c']) {
|
||||||
|
@ -220,7 +221,8 @@ class SeedDMS_SQLiteFTS_Indexer {
|
||||||
$sql .= " WHERE docs MATCH ".$this->_conn->quote($query);
|
$sql .= " WHERE docs MATCH ".$this->_conn->quote($query);
|
||||||
$res = $this->_conn->query($sql." GROUP BY `record_type`");
|
$res = $this->_conn->query($sql." GROUP BY `record_type`");
|
||||||
if(!$res)
|
if(!$res)
|
||||||
return false;
|
throw new SeedDMS_SQLiteFTS_Exception("Counting records in facet \"record_type\" failed.");
|
||||||
|
// return false;
|
||||||
$facets['record_type'] = array('document'=>0, 'folder'=>0);
|
$facets['record_type'] = array('document'=>0, 'folder'=>0);
|
||||||
foreach($res as $row) {
|
foreach($res as $row) {
|
||||||
$facets['record_type'][$row['record_type']] = $row['c'];
|
$facets['record_type'][$row['record_type']] = $row['c'];
|
||||||
|
@ -239,6 +241,8 @@ class SeedDMS_SQLiteFTS_Indexer {
|
||||||
if(!empty($limit['offset']))
|
if(!empty($limit['offset']))
|
||||||
$sql .= " OFFSET ".(int) $limit['offset'];
|
$sql .= " OFFSET ".(int) $limit['offset'];
|
||||||
$res = $this->_conn->query($sql);
|
$res = $this->_conn->query($sql);
|
||||||
|
if(!$res)
|
||||||
|
throw new SeedDMS_SQLiteFTS_Exception("Searching for documents failed.");
|
||||||
$hits = array();
|
$hits = array();
|
||||||
if($res) {
|
if($res) {
|
||||||
foreach($res as $rec) {
|
foreach($res as $rec) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user