From bf69d894caec2573121dd635a3e8a9545b2be9cd Mon Sep 17 00:00:00 2001 From: ghost Date: Tue, 1 Aug 2023 11:13:06 +0300 Subject: [PATCH] change search results piority, add PR to the page weight --- library/sphinxql.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/sphinxql.php b/library/sphinxql.php index 8b46af5..13e6ed5 100644 --- a/library/sphinxql.php +++ b/library/sphinxql.php @@ -13,13 +13,13 @@ class SphinxQL { public function searchHostPages(string $keyword, string $mime, int $start, int $limit, int $maxMatches) { - $query = $this->_sphinx->prepare('SELECT *, WEIGHT() AS `weight` + $query = $this->_sphinx->prepare('SELECT *, WEIGHT() + `rank` * 1000 AS `priority` FROM `hostPage` WHERE MATCH(?) AND `mime` = ? - ORDER BY `rank` DESC, WEIGHT() DESC + ORDER BY `priority` DESC, WEIGHT() DESC LIMIT ' . (int) ($start >= $maxMatches ? ($maxMatches > 0 ? $maxMatches - 1 : 0) : $start) . ',' . (int) $limit . '