{"_id":"mongoose-mlt","_rev":"60-02e18712fada72f371c1b9d75136f2aa","name":"mongoose-mlt","time":{"modified":"2022-06-20T07:25:28.955Z","created":"2014-09-17T19:00:18.153Z","0.1.0":"2014-09-17T19:00:20.137Z","0.1.1":"2014-09-17T19:52:02.678Z","0.1.2":"2014-09-17T20:59:31.736Z","0.1.3":"2014-09-22T19:08:57.366Z","0.1.4":"2014-09-23T20:55:05.944Z","0.1.5":"2014-09-24T15:10:30.739Z","0.1.6":"2014-09-25T20:10:18.652Z","0.1.7":"2014-12-16T18:34:22.861Z","0.2.0":"2014-12-16T21:27:49.106Z","0.2.1":"2015-02-02T16:37:52.325Z"},"maintainers":[{"email":"npm@npmjs.com","name":"npm"}],"description":"Provide more-like-this search algorithm for MongoDB","readme":"Mongoose MoreLikeThis\n=====================\n\n[Mongoose MLT](https://github.com/vkareh/mongoose-mlt) is a\n[mongoose](http://mongoosejs.com/) plugin that adds a _more-like-this_ query\ngeneration algorithm for searching relevant content.\n\nIt is heavily based on Lucene's _MoreLikeThis_, which uses\n[tf-idf](http://en.wikipedia.org/wiki/Tf-idf) statistics to characterize\ndocument relevance based a small set of terms.\n\nUsage\n-----\nDefine your schema, define your text indexes, and then load the plugin:\n```javascript\nvar MySchema = new mongoose.Schema({ ... });\nMySchema.index({ '$**': 'text' });\nMySchema.plugin(require('mongoose-mlt'), {\n  limit: 100,\n  tfThreshold: 2,\n  termLimit: 25\n});\n```\nThe following are the possible options you can pass to the plugin:\n\n* `limit`: Same as `mongoose.models.Model.find().limit(n)`.\n  It limits the number of returned results.\n  Default is 100.\n* `tfThreshold`: Determines the minimium term-frequency for any given term to be considered for search.\n  Use a higher number to provide faster matching when using large document bodies.\n  Use a lower number to provide more accurate matching when using small document bodies.\n  Default is 2.\n* `termLimit`: Limits the maximum number of terms to be used for search.\n  It uses the `n` highest scoring terms.\n  Use a higher number to provide more but less relevant results.\n  Use a lower number to provide fewer but more relevant results.\n  Default is 25.\n\nThere are several ways to use the `mlt` functionality. They all require a seed\ndocument or ObjectId:\n\n##### Static method with a seed JSON object:\n```javascript\nvar jsonSeed = { title: 'Seed', body: 'This is the seed document' };\nMyModel.mlt(jsonSeed, callback);\n```\n\n##### Static method with a seed Mongoose model:\n```javascript\nvar modelSeed = new MyModel({ title: 'Seed', body: 'This is the seed document' });\nMyModel.mlt(modelSeed, callback);\n```\n\n##### Static method with a seed `_id`\n```javascript\nMyModel.find({ title: 'Seed', body: 'This is the seed document' }, function(err, modelSeed) {\n  MyModel.mlt(modelSeed._id, callback);\n});\n```\n\nThe `mlt` method itself takes the following parameters:\n```javascript\nMyModel.mlt(seed, conditions, fields, options, callback);\n```\nwhere `seed` is the seed document or `_id`, and `conditions`, `fields`,\n`options`, and `callback` are the same as you would pass to `Model.find()`.\n\nThe `callback` for `mlt` has `err` (which is `null` on success) and `results`\n(which is an array of relevant documents, sorted by similarity).\n","versions":{"0.1.6":{"name":"mongoose-mlt","description":"Provide more-like-this search algorithm for MongoDB","version":"0.1.6","author":{"name":"Victor Kareh","email":"victor@seelio.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/seelio/mongoose-mlt"},"main":"./index.js","keywords":["mlt","mongodb","mongoose","more like this","recommendation","related","search","similar"],"dependencies":{"mongoose":"~3.8.16","natural":"~0.1.28","underscore":"~1.7.0"},"devDependencies":{"chai":"~1.9.1","mocha":"~1.21.4","istanbul":"~0.3.2"},"scripts":{"test":"mocha -R spec","coverage":"istanbul cover node_modules/mocha/bin/_mocha"},"bugs":{"url":"https://github.com/seelio/mongoose-mlt/issues"},"_id":"mongoose-mlt@0.1.6","dist":{"shasum":"8942c67da4a1c8c059a2adc55c19e9ee3a8d62bb","tarball":"https://registry.npmjs.org/mongoose-mlt/-/mongoose-mlt-0.1.6.tgz","integrity":"sha512-Fte7CpwEtXPOtU8OOcT9lvqyOfg8GMgw2G9uyCq4OsyIFPYzN/4viksvMbAYfrecKSVihCI2pXso4LMGo6j36g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHbpHWYjp+3BtVZUSljlWXuIDygCfb7tkAwRVDC71iDuAiEA4VI0pq0C5eaK7g4ev9swkP8bGGTNORhZ+DbYXLKu3xU="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"vkareh","email":"vkareh@vkareh.net"},"maintainers":[{"name":"vkareh","email":"vkareh@vkareh.net"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.1.7":{"name":"mongoose-mlt","description":"Provide more-like-this search algorithm for MongoDB","version":"0.1.7","author":{"name":"Victor Kareh","email":"victor@seelio.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/seelio/mongoose-mlt"},"main":"./index.js","keywords":["mlt","mongodb","mongoose","more like this","recommendation","related","search","similar"],"dependencies":{"mongoose":"~3.8.16","natural":"~0.1.28","underscore":"~1.7.0"},"devDependencies":{"chai":"~1.9.1","mocha":"~1.21.4","istanbul":"~0.3.2"},"scripts":{"test":"mocha -R spec","coverage":"istanbul cover node_modules/mocha/bin/_mocha"},"bugs":{"url":"https://github.com/seelio/mongoose-mlt/issues"},"_id":"mongoose-mlt@0.1.7","dist":{"shasum":"def757457d419f80367c786bf177abf5d9b73ced","tarball":"https://registry.npmjs.org/mongoose-mlt/-/mongoose-mlt-0.1.7.tgz","integrity":"sha512-jUDSGl2nrGvvZsc7fxOxp8BJeouDDatu6PGjhjUS3rXLJwYhUZEPgrgODi5qH0ObOwFjbMkL94NyhyroQuLBbw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG4hNIlxWuQwcpjrbl727vpvRZMo3Ck7faKL1NxDazMWAiANMTfIFTiT8/LQADot4HyXHatO3aa+7U3A7aE6XnO3IQ=="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"vkareh","email":"vkareh@vkareh.net"},"maintainers":[{"name":"vkareh","email":"vkareh@vkareh.net"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.0":{"name":"mongoose-mlt","description":"Provide more-like-this search algorithm for MongoDB","version":"0.2.0","author":{"name":"Victor Kareh","email":"victor@seelio.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/seelio/mongoose-mlt"},"main":"./index.js","keywords":["mlt","mongodb","mongoose","more like this","recommendation","related","search","similar"],"dependencies":{"mongoose":"~3.8.16","natural":"~0.1.28","underscore":"~1.7.0"},"devDependencies":{"chai":"~1.9.1","mocha":"~1.21.4","istanbul":"~0.3.2"},"scripts":{"test":"mocha -R spec","coverage":"istanbul cover node_modules/mocha/bin/_mocha"},"bugs":{"url":"https://github.com/seelio/mongoose-mlt/issues"},"_id":"mongoose-mlt@0.2.0","dist":{"shasum":"735ebe4292b79012f038a33325583af65fe91ae6","tarball":"https://registry.npmjs.org/mongoose-mlt/-/mongoose-mlt-0.2.0.tgz","integrity":"sha512-V4Vx+rAroMvBbtuL3UJo8YL8OqT3ePmEn6JYG9c5HtBH+jH+cJoWoUOc968wO9lNq8Ktj+28NaBumlmuCiLv9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCB+hdpQnbXkmSYi4/0VTxp0mDwpMmL0k2nV6tIA5nzxQIgCm7nqu6OI9ff/WBnubkEgiIL0O0F7no0T8w2ZMliw+A="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"vkareh","email":"vkareh@vkareh.net"},"maintainers":[{"name":"vkareh","email":"vkareh@vkareh.net"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"0.2.1":{"name":"mongoose-mlt","description":"Provide more-like-this search algorithm for MongoDB","version":"0.2.1","author":{"name":"Victor Kareh","email":"victor@seelio.com"},"license":"MIT","repository":{"type":"git","url":"git://github.com/seelio/mongoose-mlt"},"main":"./index.js","keywords":["mlt","mongodb","mongoose","more like this","recommendation","related","search","similar"],"dependencies":{"mongoose":"~3.8.16","natural":"~0.1.28","underscore":"~1.7.0"},"devDependencies":{"chai":"~1.9.1","mocha":"~1.21.4","istanbul":"~0.3.2"},"scripts":{"test":"mocha -R spec","coverage":"istanbul cover node_modules/mocha/bin/_mocha"},"bugs":{"url":"https://github.com/seelio/mongoose-mlt/issues"},"_id":"mongoose-mlt@0.2.1","dist":{"shasum":"525f1bd3fee49265198126d5fbdc2945478d973d","tarball":"https://registry.npmjs.org/mongoose-mlt/-/mongoose-mlt-0.2.1.tgz","integrity":"sha512-kiC/CzEbImr00tGMDRYdvOatMTXdOSc7I9/AL+CeUpEXIGruo4ztXqZ6Wcl2yc4kY9ocuayK5VpdzRjKljweDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFX4sCSSwfzAKiP4Xwq0Ndt7Qm0Drk6+rIza3gTZRl/AIgZ3Vds3XjY2/N9aL4jq1u+yjdbrKEhpcrd0iaDOAGe7A="}]},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"vkareh","email":"vkareh@vkareh.net"},"maintainers":[{"name":"vkareh","email":"vkareh@vkareh.net"}],"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"dist-tags":{"latest":"0.2.1"},"readmeFilename":"README.md","keywords":["mlt","mongodb","mongoose","more like this","recommendation","related","search","similar"],"repository":{"type":"git","url":"git://github.com/seelio/mongoose-mlt"},"author":{"name":"Victor Kareh","email":"victor@seelio.com"},"bugs":{"url":"https://github.com/seelio/mongoose-mlt/issues"},"license":"MIT","users":{"rcramu":true}}