diff options
author | millette <millette@controlyourself.ca> | 2008-11-20 16:50:41 -0500 |
---|---|---|
committer | millette <millette@controlyourself.ca> | 2008-11-20 16:50:41 -0500 |
commit | bf72cde96f6c60b4b7dbca6c5d011f31bcc186f7 (patch) | |
tree | 22428f693b828aef1bee8cb3ac272584dc41ff42 /classes/SearchEngines.php | |
parent | aeaf70a472fe8ac24d47c624e5570a11d8707fb6 (diff) |
sphinx search for notices
darcs-hash:20081120215041-099f7-db396a60755d551099122b58634b7550d5606d88.gz
Diffstat (limited to 'classes/SearchEngines.php')
-rw-r--r-- | classes/SearchEngines.php | 10 |
1 files changed, 6 insertions, 4 deletions
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)"); |