added "total_found" info from SHOW META stats

This commit is contained in:
SJ 2013-12-17 15:26:43 +01:00
parent 8d71cdc9aa
commit 56d046a781

View File

@ -29,6 +29,7 @@ class Sphinx {
$query->error = 1; $query->error = 1;
$query->errmsg = "Error"; $query->errmsg = "Error";
$query->query = $sql; $query->query = $sql;
$query->total_found = 0;
$time_start = microtime(true); $time_start = microtime(true);
@ -62,6 +63,11 @@ class Sphinx {
$query->exec_time = $time_end - $time_start; $query->exec_time = $time_end - $time_start;
$meta = $this->link->prepare("show meta like 'total_found'");
$meta->execute();
$R = $meta->fetch();
if(isset($R[1])) { $query->total_found = $R[1]; }
return $query; return $query;
} }