Skip to content

Commit 0096824

Browse files
committed
Revert "fixed issue with search projection meta"
This reverts commit 49dbde5.
1 parent 49dbde5 commit 0096824

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

models/Users.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ var Schema = db.Schema(schemaObject);
5959
// Schema.index({'tags': 'text'});
6060

6161
Schema.statics.search = function(string) {
62-
return this.find({$text: {$search: string}});
62+
return this.find({$text: {$search: string}}, { score : { $meta: "textScore" } })
63+
.sort({ score : { $meta : 'textScore' } });
6364
};
6465

6566
// assign a function to the "methods" object of our Schema

0 commit comments

Comments
 (0)