Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exception in delivering result of invoking 'search.source': Error: Match failed [400] #20

Open
Bandit opened this issue May 11, 2015 · 3 comments

Comments

@Bandit
Copy link

Bandit commented May 11, 2015

Not sure where to even start with this one. Any ideas?

SearchSource.defineSource("bookings", function(searchText, options) {
      var options = (typeof options == "object") ? options : { sort: { isoScore: -1 }, limit: 20 };

      if(searchText) {

        var regExp = new RegExp("(" + searchText.trim().split(" ").join("|") + ")", "ig");

        console.info(searchText, regExp);

        var selector = { $or: [
          { customer: regExp },
          { notes: regExp }
        ]};

        return Bookings.find(selector, options).fetch();

      }
      else {

        return Bookings.find({}, options).fetch();

      }

    });
@arunoda
Copy link
Member

arunoda commented May 11, 2015

not sure why? Here's the place we track that.
You may need to send the searcText as string.
See: https://github.com/meteorhacks/search-source/blob/master/lib/server.js#L10

@svda
Copy link

svda commented Jun 18, 2015

I have this same error when trying to send options to the server, i.e.
PackageSearch('test', { limit: 100 }) gives the above error. It does work when the options are not an object but string, so it looks like a bug in checking the options parameter on the server.

@svda
Copy link

svda commented Jun 19, 2015

Never mind, this happened when using SearchSource 0.0.2. For some reason this is the default version that is being used when it's included in another package without specifying the package version. After using 'meteorhacks:[email protected]' in my package all was fine...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants