From 746cc228a9eaa50f3f812c946f7a5ebec244ab14 Mon Sep 17 00:00:00 2001 From: ghost Date: Wed, 10 May 2023 15:42:48 +0300 Subject: [PATCH] update page rank query --- config/sphinx.conf.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/config/sphinx.conf.txt b/config/sphinx.conf.txt index 06ef702..a28f5f9 100644 --- a/config/sphinx.conf.txt +++ b/config/sphinx.conf.txt @@ -16,9 +16,10 @@ source hostPage : common `hostPage`.`uri`, \ `host`.`name`, \ REGEXP_REPLACE(`hostPage`.`mime`, '^[A-z-]+/([A-z-]+).*', '$1') AS `mime`, \ - (SELECT COUNT(*) FROM `hostPageToHostPage` \ - WHERE `hostPageToHostPage`.`hostPageIdTarget` = `hostPage`.`hostPageId` \ - AND `hostPageToHostPage`.`hostPageIdSource` <> `hostPage`.`hostPageId`) AS `rank`, \ + (SELECT SUM(`quantity`) FROM `hostPageToHostPage` \ + WHERE `hostPageToHostPage`.`hostPageIdTarget` = `hostPage`.`hostPageId` \ + AND (SELECT `hostPageSource`.`hostId` FROM `hostPage` AS `hostPageSource` \ + WHERE `hostPageSource`.`hostPageId` = `hostPageToHostPage`.`hostPageIdSource`) <> `hostPage`.`hostId`) AS `rank`, \ (SELECT GROUP_CONCAT(CONCAT_WS(' ', `hostPageDescription`.`title`, \ `hostPageDescription`.`description`, \ `hostPageDescription`.`keywords`)) \ @@ -26,7 +27,7 @@ source hostPage : common WHERE `hostPageDescription`.`hostPageId` = `hostPage`.`hostPageId`) AS `pageDescription` \ FROM `hostPage` \ JOIN `host` ON (`host`.`hostId` = `hostPage`.`hostId`) \ - WHERE `host`.`status` = '1' AND `hostPage`.`httpCode` = 200 AND `hostPage`.`timeBanned` IS NULL + WHERE `host`.`status` = '1' AND `hostPage`.`httpCode` = 200 AND `hostPage`.`timeBanned` IS NULL\ sql_attr_uint = rank sql_attr_string = mime