I'm trying to use this package to search data that's not been published to the client. I understand that this is possible however I can't quite figure it out. Help please :)
Currently my index is configured as such :
UserIndex = new EasySearch.Index({
collection: Meteor.users,
fields: ['username', 'realname', 'bio', 'email'],
engine: new EasySearch.MongoDB({
selectorPerField: function (field, searchString) {
if ('emails' === field) {
// return this selector if the email field is being searched
return {
emails: {
$elemMatch: {
address: { '$regex' : '.*' + searchString + '.*', '$options' : 'i' }
}
}
};
}
// use the default otherwise
return this.defaultConfiguration().selectorPerField(field, searchString);
}),
});
Removing the selectorPerField returns users.
But how can I incorporate them (temporarily if possible) in the data that's accessible on the client?
Also what's wrong with my selector?
I'm trying to use this package to search data that's not been published to the client. I understand that this is possible however I can't quite figure it out. Help please :)
Currently my index is configured as such :