summaryrefslogtreecommitdiff
path: root/actions/noticesearch.php
diff options
context:
space:
mode:
authormillette <millette@controlyourself.ca>2008-11-23 13:51:36 -0500
committermillette <millette@controlyourself.ca>2008-11-23 13:51:36 -0500
commit6b29f6ed702f69a9b1b6a9359c1eaa22b9c5ba9d (patch)
tree10d65cc9d2cbfc71b475522a347000c804218623 /actions/noticesearch.php
parentbf72cde96f6c60b4b7dbca6c5d011f31bcc186f7 (diff)
sphinx integration for notices and profiles
darcs-hash:20081123185136-099f7-ca600dbdfff09762802e1cc58cf8777c45a24402.gz
Diffstat (limited to 'actions/noticesearch.php')
-rw-r--r--actions/noticesearch.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/actions/noticesearch.php b/actions/noticesearch.php
index f8dad2a20..96e4d777f 100644
--- a/actions/noticesearch.php
+++ b/actions/noticesearch.php
@@ -20,7 +20,6 @@
if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/searchaction.php');
-define('NOTICES_PER_PAGE', 20);
# XXX common parent for people and content search?
@@ -42,13 +41,17 @@ class NoticesearchAction extends SearchAction {
$q = strtolower($q);
$search_engine = $notice->getSearchEngine('identica_notices');
- $search_engine->query($q);
+ $search_engine->set_sort_mode('chron');
# Ask for an extra to see if there's more.
$search_engine->limit((($page-1)*NOTICES_PER_PAGE), NOTICES_PER_PAGE + 1);
- $cnt = $notice->find();
-
+ if (false === $search_engine->query($q)) {
+ $cnt = 0;
+ }
+ else {
+ $cnt = $notice->find();
+ }
if ($cnt > 0) {
$terms = preg_split('/[\s,]+/', $q);
common_element_start('ul', array('id' => 'notices'));