Git Product home page Git Product logo

mongoose-search-plugin's People

Contributors

bitdeli-chef avatar mika-s avatar pavelvlasov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

mongoose-search-plugin's Issues

TypeError: Cannot read property 'stemmer' of undefined

    var stemmer = natural[options.stemmer || 'PorterStemmer'],
                                 ^

TypeError: Cannot read property 'stemmer' of undefined
at module.exports (/home/Downloads/Web-Dev/Projects/sam-app/node_modules/mongoose-search-plugin/index.js:8:3
1)
at Object. (/home/Downloads/Web-Dev/Projects/sam-app/models/reports.js:36:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/Downloads/Web-Dev/Projects/sam-app/routes/index.js:21:14)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object. (/home/Downloads/Web-Dev/Projects/sam-app/app.js:15:21)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
Program node bin/www exited with code 1

Plugin doesn't load before statics methods

If I use MySchema.plugin(searchPlugin,...) before statics methods declaration, the plugin won't load.

But when I move it after statics declaration, it works:

MySchema.statics = {
  list: function (options, cb) {
    var criteria = options.criteria || {}
    this.find(criteria)
      .sort({'createdAt': -1}) // sort by date
      .limit(options.perPage)
      .skip(options.perPage * options.page)
      .exec(cb);
  }
}

MySchema.plugin(searchPlugin, { 
  fields: ['title', 'authors'] 
});

Special characters removed

Hi,

I have a problem with some words in French. For exemple: "récépissé" which is transformed to "piss". So "ré", "cé" and the last character "é" are being removed.

Do you have an option to resolve this problem ?

Thanks !

keywords won't update after model update/findoneandupdate

What happens if I want to update keywords in a 'PUT' method where I update one document. The setKeywords method updates all the documents of the collection which can be particularly slow. The updateKeywords is a synchronous function which cannot be called with a callback and thus cannot be used. Any ideas?

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

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

.setKeywords method fails on validation

I am using this plugin on an existing collection. As the documentation states, I run

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

to initialize the keywords field, how ever I populated this collection using mongoimport which will not run any validation or middleware present on the schema. When Model.setKeywords run, I get validation error on fields that fail validation. I replaced lines 133 - 136 with

                    doc.collection.insert(function(err) {
                        if (err) console.log('[mongoose search plugin err] ', err, err.stack);
                        done();
                    });

I know this uses MongoDB native driver directly. It seems to solve my problem. I looked through the source code, I hope this doesnt break anything else. Is there a better way to solve this?

Cleanup non issue

When my account was compromised a spam issue was created in this repo. I sincerely apologize. Cleaning up such issues via script.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.