From 3632a76773dbfc31cf6f99ad831bf13f793871ae Mon Sep 17 00:00:00 2001 From: CiaranG Date: Sun, 14 Sep 2008 16:17:44 -0400 Subject: PostgreSQL: support for full text searching (notice and people) darcs-hash:20080914201744-f6e2c-71b2a3aec4c0b91557465323d79645e7eab2bfd1.gz --- actions/peoplesearch.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'actions/peoplesearch.php') diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index adacc0954..4e0ec3f0c 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -39,8 +39,13 @@ class PeoplesearchAction extends SearchAction { # lcase it for comparison $q = strtolower($q); - $profile->whereAdd('MATCH(nickname, fullname, location, bio, homepage) ' . + + 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).'\')'); + } # Ask for an extra to see if there's more. -- cgit v1.2.3-54-g00ecf