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 --- actions/peoplesearch.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'actions/peoplesearch.php') diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index 6b03169a0..d493c7667 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -40,16 +40,12 @@ class PeoplesearchAction extends SearchAction { # lcase it for comparison $q = strtolower($q); - if(common_config('db','type')=='mysql') { - $profile->whereAdd('MATCH(nickname, fullname, location, bio, homepage) ' . - 'against (\''.addslashes($q).'\')'); - } else { - $profile->whereAdd('textsearch @@ plainto_tsquery(\''.addslashes($q).'\')'); - } + $search_engine = $profile->getSearchEngine(); - # Ask for an extra to see if there's more. + $search_engine->query($q); - $profile->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1); + # Ask for an extra to see if there's more. + $search_engine->limit((($page-1)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1); $cnt = $profile->find(); -- cgit v1.2.3-54-g00ecf