From 0bd6f7645159095be3a39e01888eab116b397883 Mon Sep 17 00:00:00 2001 From: millette Date: Thu, 20 Nov 2008 16:13:47 -0500 Subject: sphinx search of people darcs-hash:20081120211347-099f7-d5588788dcd9a16cf72ece59da3d2bf9b8171b85.gz --- classes/Profile.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'classes/Profile.php') diff --git a/classes/Profile.php b/classes/Profile.php index 794dc1de9..9de92ec4b 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -46,6 +46,21 @@ class Profile extends Memcached_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + function getSearchEngine() { + require_once INSTALLDIR.'/classes/SearchEngines.php'; + static $search_engine; + if (!isset($search_engine)) { + if (common_config('sphinx', 'enabled')) { + $search_engine = new SphinxSearch($this); + } elseif ('mysql' === common_config('db', 'type')) { + $search_engine = new MySQLSearch($this); + } else { + $search_engine = new PGSearch($this); + } + } + return $search_engine; + } + function getAvatar($width, $height=NULL) { if (is_null($height)) { $height = $width; -- cgit v1.2.3-54-g00ecf