From 6b29f6ed702f69a9b1b6a9359c1eaa22b9c5ba9d Mon Sep 17 00:00:00 2001 From: millette Date: Sun, 23 Nov 2008 13:51:36 -0500 Subject: sphinx integration for notices and profiles darcs-hash:20081123185136-099f7-ca600dbdfff09762802e1cc58cf8777c45a24402.gz --- actions/peoplesearch.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'actions/peoplesearch.php') 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); -- cgit v1.2.3-54-g00ecf