summaryrefslogtreecommitdiff
path: root/actions/peoplesearch.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/peoplesearch.php
parentbf72cde96f6c60b4b7dbca6c5d011f31bcc186f7 (diff)
sphinx integration for notices and profiles
darcs-hash:20081123185136-099f7-ca600dbdfff09762802e1cc58cf8777c45a24402.gz
Diffstat (limited to 'actions/peoplesearch.php')
-rw-r--r--actions/peoplesearch.php14
1 files changed, 8 insertions, 6 deletions
diff --git a/actions/peoplesearch.php b/actions/peoplesearch.php
index fa54dc9f7..f4886fd83 100644
--- a/actions/peoplesearch.php
+++ b/actions/peoplesearch.php
@@ -20,7 +20,7 @@
if (!defined('LACONICA')) { exit(1); }
require_once(INSTALLDIR.'/lib/searchaction.php');
-require_once(INSTALLDIR.'/lib/profilelist.php');
+define('PROFILES_PER_PAGE', 10);
class PeoplesearchAction extends SearchAction {
@@ -42,13 +42,15 @@ class PeoplesearchAction extends SearchAction {
$search_engine = $profile->getSearchEngine('identica_people');
- $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)*PROFILES_PER_PAGE), PROFILES_PER_PAGE + 1);
-
- $cnt = $profile->find();
-
+ if (false === $search_engine->query($q)) {
+ $cnt = 0;
+ }
+ else {
+ $cnt = $profile->find();
+ }
if ($cnt > 0) {
$terms = preg_split('/[\s,]+/', $q);
$results = new PeopleSearchResults($profile, $terms);