diff options
author | millette <millette@controlyourself.ca> | 2008-11-20 16:13:47 -0500 |
---|---|---|
committer | millette <millette@controlyourself.ca> | 2008-11-20 16:13:47 -0500 |
commit | 0bd6f7645159095be3a39e01888eab116b397883 (patch) | |
tree | c9cf3b71cf7d83b1601b3024c795e87844e6a4ea /actions/peoplesearch.php | |
parent | 297744353449ad0cdcd9f7d971932386abe8f7d4 (diff) |
sphinx search of people
darcs-hash:20081120211347-099f7-d5588788dcd9a16cf72ece59da3d2bf9b8171b85.gz
Diffstat (limited to 'actions/peoplesearch.php')
-rw-r--r-- | actions/peoplesearch.php | 12 |
1 files changed, 4 insertions, 8 deletions
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(); |