diff options
author | millette <millette@controlyourself.ca> | 2008-11-23 13:51:36 -0500 |
---|---|---|
committer | millette <millette@controlyourself.ca> | 2008-11-23 13:51:36 -0500 |
commit | 6b29f6ed702f69a9b1b6a9359c1eaa22b9c5ba9d (patch) | |
tree | 10d65cc9d2cbfc71b475522a347000c804218623 /actions/noticesearchrss.php | |
parent | bf72cde96f6c60b4b7dbca6c5d011f31bcc186f7 (diff) |
sphinx integration for notices and profiles
darcs-hash:20081123185136-099f7-ca600dbdfff09762802e1cc58cf8777c45a24402.gz
Diffstat (limited to 'actions/noticesearchrss.php')
-rw-r--r-- | actions/noticesearchrss.php | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/actions/noticesearchrss.php b/actions/noticesearchrss.php index f598d833e..0f38515a0 100644 --- a/actions/noticesearchrss.php +++ b/actions/noticesearchrss.php @@ -39,19 +39,12 @@ class NoticesearchrssAction extends Rss10Action { # lcase it for comparison $q = strtolower($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. - - if ($limit != 0) { - $notice->limit(0, $limit); - } + $search_engine = $notice->getSearchEngine('identica_notices'); + $search_engine->set_sort_mode('chron'); + if (!$limit) $limit = 20; + $search_engine->limit(0, $limit, true); + $search_engine->query($q); $notice->find(); while ($notice->fetch()) { |