Explorar o código

Try to fix EasySearch. Part 3.

Thanks to danielkaiser and xet7 !
Lauri Ojansivu %!s(int64=2) %!d(string=hai) anos
pai
achega
0d3b7ca041
Modificáronse 1 ficheiros con 11 adicións e 3 borrados
  1. 11 3
      models/users.js

+ 11 - 3
models/users.js

@@ -539,9 +539,17 @@ Users.allow({
 // is used for instance to add a new user to a board.
 UserSearchIndex = new Index({
   collection: Users,
-  fields: ['username', 'profile.fullname', 'emails.address'],
-  allowedFields: ['username', 'profile.fullname', 'emails.address'],
-  engine: new MongoDBEngine(),
+  fields: ['username', 'profile.fullname', 'profile.avatarUrl'],
+  allowedFields: ['username', 'profile.fullname', 'profile.avatarUrl'],
+  engine: new MongoDBEngine({
+    fields: function(searchObject, options) {
+      return {
+        'username': 1,
+        'profile.fullname': 1,
+        'profile.avatarUrl': 1
+      };
+    }
+  }),
 });
 
 Users.safeFields = {