meteorhacks / search-source

Reactive Data Source for Search
MIT License
146 stars 33 forks source link

Transform method not hit in .getData #56

Open ghost opened 8 years ago

ghost commented 8 years ago

Greetings! I'm working through your example (thank you) however running into problems getting the transform to fire.

The docTransform hits every time. But never the transform.

Any ideas?

`Template.SearchResults.helpers({ offender: function() {

return OffenderSearch.getData({
  transform: function (matchText, regExp) {
    console.log('hit transform');
    return matchText.replace(regExp, "<b>$&</b>");
  },

  docTransform: function(doc) {
    console.log('hit docTransform');
    return doc;
  }
});

}`

s4admin commented 8 years ago

You have to pass in a list of fields on the client side for it to work.