From 5a4cd845dea2bf07a50d3689ff0948643031d199 Mon Sep 17 00:00:00 2001 From: ghost Date: Sun, 13 Aug 2023 19:48:01 +0300 Subject: [PATCH] update sphinx.conf example --- example/environment /sphinx.conf | 32 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/ example/environment /sphinx.conf b/ example/environment /sphinx.conf index ca1de55..e64f191 100644 --- a/ example/environment /sphinx.conf +++ b/ example/environment /sphinx.conf @@ -2,20 +2,19 @@ source yggstate { type = mysql + sql_port = 3306 sql_host = localhost sql_user = sql_pass = sql_db = - sql_port = 3306 # optional, default is 3306 } source peer : yggstate { - sql_query = \ - SELECT `peer`.`key`, \ - `peer`.`address`, \ - `peer`.`peerId`, \ - `peer`.`timeAdded`, \ + sql_query = \ + SELECT `peer`.`peerId`, \ + `peer`.`address` AS `peerAddress`, \ + `peer`.`key` AS `peerKey`, \ (SELECT GROUP_CONCAT(DISTINCT `peerCoordinate`.`port`) \ FROM `peerCoordinate` \ WHERE `peerCoordinate`.`peerId` = `peer`.`peerId`) AS `peerCoordinatePort`, \ @@ -26,25 +25,24 @@ source peer : yggstate (SELECT GROUP_CONCAT(DISTINCT `peerRemoteScheme`.`name`) \ FROM `peerRemote` \ JOIN `peerRemoteScheme` ON (`peerRemoteScheme`.`peerRemoteSchemeId` = `peerRemote`.`peerRemoteSchemeId`) \ - WHERE `peerRemote`.`peerId` = `peer`.`peerId`) AS `remoteScheme`, \ + WHERE `peerRemote`.`peerId` = `peer`.`peerId`) AS `peerRemoteScheme`, \ (SELECT GROUP_CONCAT(DISTINCT `peerRemoteHost`.`name`) \ FROM `peerRemote` \ JOIN `peerRemoteHost` ON (`peerRemoteHost`.`peerRemoteHostId` = `peerRemote`.`peerRemoteHostId`) \ - WHERE `peerRemote`.`peerId` = `peer`.`peerId`) AS `remoteHost`, \ + WHERE `peerRemote`.`peerId` = `peer`.`peerId`) AS `peerRemoteHost`, \ (SELECT GROUP_CONCAT(DISTINCT `peerRemotePort`.`name`) \ FROM `peerRemote` \ JOIN `peerRemotePort` ON (`peerRemotePort`.`peerRemotePortId` = `peerRemote`.`peerRemotePortId`) \ - WHERE `peerRemote`.`peerId` = `peer`.`peerId`) AS `remotePort` \ + WHERE `peerRemote`.`peerId` = `peer`.`peerId`) AS `peerRemotePort` \ FROM `peer`\ - sql_attr_string = address - sql_attr_string = key - sql_attr_string = peerCoordinatePort - sql_attr_string = peerCoordinateRoute - sql_attr_string = remoteScheme - sql_attr_string = remoteHost - sql_attr_uint = remotePort - sql_attr_uint = timeAdded + sql_field_string = peerAddress + sql_field_string = peerKey + sql_field_string = peerCoordinatePort + sql_field_string = peerCoordinateRoute + sql_field_string = peerRemoteScheme + sql_field_string = peerRemoteHost + sql_field_string = peerRemotePort } index peer