diff options
author | CiaranG <ciaran@ciarang.com> | 2008-09-14 16:17:44 -0400 |
---|---|---|
committer | CiaranG <ciaran@ciarang.com> | 2008-09-14 16:17:44 -0400 |
commit | 3632a76773dbfc31cf6f99ad831bf13f793871ae (patch) | |
tree | 85c8a0b54f297bd9e09671b5f7b02a98660da8f3 /actions/noticesearchrss.php | |
parent | b13233fed40ee132779906cfa29e00f8c28631df (diff) |
PostgreSQL: support for full text searching (notice and people)
darcs-hash:20080914201744-f6e2c-71b2a3aec4c0b91557465323d79645e7eab2bfd1.gz
Diffstat (limited to 'actions/noticesearchrss.php')
-rw-r--r-- | actions/noticesearchrss.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php index c9d08ce8e..f598d833e 100644 --- a/actions/noticesearchrss.php +++ b/actions/noticesearchrss.php @@ -39,7 +39,11 @@ class NoticesearchrssAction extends Rss10Action { # lcase it for comparison $q = strtolower($q); - $notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')'); + if(common_config('db','type')=='mysql') { + $notice->whereAdd('MATCH(content) against (\''.addslashes($q).'\')'); + } else { + $notice->whereAdd('to_tsvector(\'english\',content) @@ plainto_tsquery(\''.addslashes($q).'\')'); + } $notice->orderBy('created DESC, notice.id DESC'); # Ask for an extra to see if there's more. @@ -70,4 +74,4 @@ class NoticesearchrssAction extends Rss10Action { function get_image() { return NULL; } -}
\ No newline at end of file +} |