]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Reverted groups and users to LIKE instead of MATCH AGAINST.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 7 Nov 2009 21:02:50 +0000 (21:02 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Sat, 7 Nov 2009 21:02:50 +0000 (21:02 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@3634 36083f99-b078-4883-b0ff-0f9b5a30f544

mod/search/search_hooks.php

index f673b7512ec062247dc7ce725581e8e3b3e5bf3c..abe85d9625583e85c2d093aaeac2dfe4d3e6670f 100644 (file)
@@ -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%'