From 18acd536a3e1d39b4e05261bf87bb28da396b794 Mon Sep 17 00:00:00 2001 From: brettp Date: Sat, 7 Nov 2009 21:02:50 +0000 Subject: Reverted groups and users to LIKE instead of MATCH AGAINST. git-svn-id: http://code.elgg.org/elgg/trunk@3634 36083f99-b078-4883-b0ff-0f9b5a30f544 --- mod/search/search_hooks.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'mod') diff --git a/mod/search/search_hooks.php b/mod/search/search_hooks.php index f673b7512..abe85d962 100644 --- a/mod/search/search_hooks.php +++ b/mod/search/search_hooks.php @@ -72,15 +72,14 @@ function search_groups_hook($hook, $type, $value, $params) { $join = "JOIN {$CONFIG->dbprefix}groups_entity ge ON e.guid = ge.guid"; $params['joins'] = array($join); - $fields = array('name', 'description'); - - $where = search_get_where_sql('ge', $fields, $params); + $where = "(ge.guid = e.guid + AND (ge.name LIKE '%$query%' + OR ge.description LIKE '%$query%' + ) + )"; $params['wheres'] = array($where); - //@todo allow sorting by recent time - $params['order_by'] = NULL; - $entities = elgg_get_entities($params); $params['count'] = TRUE; $count = elgg_get_entities($params); @@ -122,7 +121,6 @@ function search_users_hook($hook, $type, $value, $params) { $join = "JOIN {$CONFIG->dbprefix}users_entity ue ON e.guid = ue.guid"; $params['joins'] = array($join); - // use like here because of the simplicity of the search $where = "(ue.guid = e.guid AND (ue.username LIKE '%$query%' OR ue.name LIKE '%$query%' -- cgit v1.2.3