I believe the problem is the lack of options passed to GuideSearch.search method.
This causes the search definition handler to get null for the parameters.
SearchSource.defineSource('guides', function(searchText, options) { if(searchText) { var regExp = buildRegExp(searchText); var selector = {title: regExp} return Guides.find(selector, options).fetch();
This causes the find() collection method to get null arguments, which, if specified, should be an object (not null ).
Therefore, either check for options zero in the data source and pass an empty object (or nothing) to the find() method, or pass an empty object to the GuideSearch.search() method:
Template.guide_list.events({ "keyup #title": _.throttle(function(e) { var text = $(e.target).val().trim(); GuideSearch.search(text, {});
You should probably make sure that options are not null in the server method, as in @webdeb's answer anyway.
In addition, at the moment some packages ( check and ejson ) should be added as dependencies to your application, since the meteorhacks:search-source package uses them without declaring a dependency. This is due to changes made in v1.2.0. (before that, these symbols were automatically available for packages).
To get the original results, you can initiate a search when the template is first created. Note that this can be quite expensive when you have a lot of data, so you should probably limit the results returned by the search definition handler on the server.
Template.guide_list.onCreated(function () { GuideSearch.search('', {}); });
To correctly display the title in the search results, you can use Spacebars.SafeString() to know how to do this, like HTML.
Template.guide_list.helpers({ getGuides: function () { return GuideSearch.getData({ transform: function (matchText, regExp) { return Spacebars.SafeString(matchText.replace(regExp, "<b>$&</b>")) } }); }, formatId: function(id) { return id; }, moFormat: function(date, format) { return moment(date).format(format); }, isLoading: function () { return GuideSearch.getStatus().loading; } }); Template.guide_list.events({ "keyup #title": _.throttle(function(e) { var text = $(e.target).val().trim(); GuideSearch.search(text, {}); }, 200) });
or alternatively use triple-bracket notation:
a(href="/guide/{{formatId _id}}") {{{title}}}
Warning: be sure to clean matchText with this.
Publications should not have anything to do with the results, as the package uses its own collection.