From 0bda87fbe664db0e87c0349fd05a9b68ee546ba4 Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 1 Aug 2023 11:17:29 +0300 Subject: [PATCH] fix priority calculation on zero value in PR --- library/sphinxql.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/sphinxql.php b/library/sphinxql.php index 13e6ed5..3e12b0a 100644 --- a/library/sphinxql.php +++ b/library/sphinxql.php @@ -13,7 +13,7 @@ class SphinxQL { public function searchHostPages(string $keyword, string $mime, int $start, int $limit, int $maxMatches) { - $query = $this->_sphinx->prepare('SELECT *, WEIGHT() + `rank` * 1000 AS `priority` + $query = $this->_sphinx->prepare('SELECT *, WEIGHT() + `rank` * IF (`rank` > 0, 1000, 1) AS `priority` FROM `hostPage`