diff options
author | millette <millette@controlyourself.ca> | 2008-11-20 16:50:41 -0500 |
---|---|---|
committer | millette <millette@controlyourself.ca> | 2008-11-20 16:50:41 -0500 |
commit | bf72cde96f6c60b4b7dbca6c5d011f31bcc186f7 (patch) | |
tree | 22428f693b828aef1bee8cb3ac272584dc41ff42 /actions | |
parent | aeaf70a472fe8ac24d47c624e5570a11d8707fb6 (diff) |
sphinx search for notices
darcs-hash:20081120215041-099f7-db396a60755d551099122b58634b7550d5606d88.gz
Diffstat (limited to 'actions')
-rw-r--r-- | actions/noticesearch.php | 10 | ||||
-rw-r--r-- | actions/peoplesearch.php | 2 |
2 files changed, 4 insertions, 8 deletions
diff --git a/actions/noticesearch.php b/actions/noticesearch.php index bc052d512..f8dad2a20 100644 --- a/actions/noticesearch.php +++ b/actions/noticesearch.php @@ -41,15 +41,11 @@ class NoticesearchAction extends SearchAction { # 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).'\')'); - } + $search_engine = $notice->getSearchEngine('identica_notices'); + $search_engine->query($q); # Ask for an extra to see if there's more. - - $notice->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1); + $search_engine->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1); $cnt = $notice->find(); diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php index d493c7667..fa54dc9f7 100644 --- a/actions/peoplesearch.php +++ b/actions/peoplesearch.php @@ -40,7 +40,7 @@ class PeoplesearchAction extends SearchAction { # lcase it for comparison $q = strtolower($q); - $search_engine = $profile->getSearchEngine(); + $search_engine = $profile->getSearchEngine('identica_people'); $search_engine->query($q); |