From 57f64f6b903b1ad0aae8ac420a81f427fb10bce4 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 25 Apr 2023 16:53:13 +0300 Subject: [PATCH] add hostPage weight and rank info --- public/api.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } }