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

TypeError: text.split is not a function ... #7

Open
LizanLycan opened this issue Apr 20, 2017 · 2 comments
Open

TypeError: text.split is not a function ... #7

LizanLycan opened this issue Apr 20, 2017 · 2 comments

Comments

@LizanLycan
Copy link

Node version: v6.9.4

I'm using Electron cross platform.

ERROR:

TypeError: text.split is not a function at AggresiveTokenizer.tokenize ...
at stemmer.tokenizeAndStem ...
at Function.schema.statics.search (...\mongoose-search-plugin\index.js: 36:26) ...

I probe it in a new Model in the database, and I don't use the .setKeywords

@ghost
Copy link

ghost commented May 16, 2017

Reviewing the code, the problem seem to be related with the natural library.
The problem persist after putting the

 Model.setKeywords(function(err) {
    // ...
  });

at the bottom of all models that use this plugin ?

Also be sure that mongoose will run in the main process, not in the render.

@LizanLycan
Copy link
Author

Yeah, the problem persist. Everything used with the plugin is directly in the main process. Find a solution using $ regex from Mongo, I have not used the plugin again, sorry.

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

1 participant