From bf72cde96f6c60b4b7dbca6c5d011f31bcc186f7 Mon Sep 17 00:00:00 2001 From: millette Date: Thu, 20 Nov 2008 16:50:41 -0500 Subject: sphinx search for notices darcs-hash:20081120215041-099f7-db396a60755d551099122b58634b7550d5606d88.gz --- classes/SearchEngines.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'classes/SearchEngines.php') diff --git a/classes/SearchEngines.php b/classes/SearchEngines.php index e5f4e14ea..253e0028b 100644 --- a/classes/SearchEngines.php +++ b/classes/SearchEngines.php @@ -21,9 +21,11 @@ if (!defined('LACONICA')) { exit(1); } class SearchEngine { protected $profile; + protected $table; - function __construct($profile) { + function __construct($profile, $table) { $this->profile = $profile; + $this->table = $table; } function query($q) { @@ -37,8 +39,8 @@ class SearchEngine { class SphinxSearch extends SearchEngine { private $sphinx; - function __construct($profile) { - parent::__construct($profile); + function __construct($profile, $table) { + parent::__construct($profile, $table); $this->sphinx = new SphinxClient; $this->sphinx->setServer(common_config('sphinx', 'server'), common_config('sphinx', 'port')); } @@ -49,7 +51,7 @@ class SphinxSearch extends SearchEngine { } function query($q) { - $result = $this->sphinx->query($q); + $result = $this->sphinx->query($q, $this->table); if (!isset($result['matches'])) return false; $id_set = join(', ', array_keys($result['matches'])); return $this->profile->whereAdd("id in ($id_set)"); -- cgit v1.2.3-54-g00ecf