aboutsummaryrefslogtreecommitdiff
path: root/mod
diff options
context:
space:
mode:
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-07 21:02:50 +0000
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>2009-11-07 21:02:50 +0000
commit18acd536a3e1d39b4e05261bf87bb28da396b794 (patch)
tree6e36ff3aec1de14c155795b138b97fe7ad16cdce /mod
parent24e3ff747614364d0d44fc1a7644f164146c66e1 (diff)
downloadelgg-18acd536a3e1d39b4e05261bf87bb28da396b794.tar.gz
elgg-18acd536a3e1d39b4e05261bf87bb28da396b794.tar.bz2
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
Diffstat (limited to 'mod')
-rw-r--r--mod/search/search_hooks.php12
1 files changed, 5 insertions, 7 deletions
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%'