meteorhacks / search-source

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

_buildRegExp does not work when you have custom analyzer filters like asciifolding #22

Open olivierpascal opened 9 years ago

olivierpascal commented 9 years ago

Problem is with the following code in client.js (and especially the _buildRegExp function):

  // only do client side searching if we are on the loading state
  // once loaded, we need to send all of them
  if(this.getStatus().loading) {
    self.searchFields.forEach(function(field) {
      var singleQuery = {};
      singleQuery[field] = regExp;
      selector['$or'].push(singleQuery);
    });
  } else {
    selector = {};
  }

If my query is "oeuf" and cached results contain a field value "œuf" (note the œ), when the search will be in "loading" state, "œuf" will disappear, until the search will switch in "loaded" state.