diff --git a/public/api.php b/public/api.php index 22432b1..db39e3b 100644 --- a/public/api.php +++ b/public/api.php @@ -35,11 +35,13 @@ if (API_ENABLED) { // Generate results $dbResults = []; - foreach ($sphinxResults as $sphinxResult) { + foreach ($sphinxResults as $i => $sphinxResult) { if ($hostPage = $db->getFoundHostPage($sphinxResult->id)) { - $dbResults[] = $hostPage; + $dbResults[$i] = $hostPage; + + $dbResults[$i]->weight = $sphinxResult->weight; } }