{"_id":"mongoose-text-search","_rev":"30-8675f6aacf8d07a92aac209291c95036","name":"mongoose-text-search","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"mongoose-text-search","version":"0.0.1","keywords":["mongoose","text","search","plugin","mongodb","fulltext"],"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"license":"MIT","_id":"mongoose-text-search@0.0.1","maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"dist":{"shasum":"d6de490413a41d6152a164854a289211ba95f0f5","tarball":"https://registry.npmjs.org/mongoose-text-search/-/mongoose-text-search-0.0.1.tgz","integrity":"sha512-CQnnDE48ZuR7jb36DqRR6s+ZZt784kg3LXsZ0TX65lg1sYLpXx2c1r4sROTr4QEJM/tKMvj2nWiifXaac0hPMw==","signatures":[{"sig":"MEQCIByHzZqx0Q7+471LPppkvg0gWJIEcPhXSUZckXvGI98XAiBptLc23pJCJAuy4Z9aB0nH0AsVX9ArPWkwYgbOj2gc3Q==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","readme":"#mongoose-text-search\n======================\n\nProvides MongoDB 2.4 text search support for mongoose.\n\n[![Build Status](https://travis-ci.org/aheckmann/mongoose-text-search.png?branch=master)](https://travis-ci.org/aheckmann/mongoose-text-search)\n\n## Example:\n\n```js\n// modules\nvar mongoose = require('mongoose');\nvar textSearch = require('mongoose-text-search');\n\n// create our schema\nvar gameSchema = mongoose.Schema({\n    name: String\n  , tags: [String]\n  , likes: Number\n  , created: Date\n});\n\n// give our schema text search capabilities\ngameSchema.plugin(textSearch);\n\n// add a text index to the tags array\ngameSchema.index({ tags: 'text' });\n\n// test it out\nvar Game = mongoose.model('Game', gameSchema);\n\nGame.create({ name: 'Super Mario 64', tags: ['nintendo', 'mario', '3d'] }, function (err) {\n  if (err) return handleError(err);\n\n  Game.textSearch('3d', function (err, output) {\n    if (err) return handleError(err);\n\n    var inspect = require('util').inspect;\n    console.log(inspect(output, { depth: null }));\n\n    // { queryDebugString: '3d||||||',\n    //   language: 'english',\n    //   results:\n    //    [ { score: 1,\n    //        obj:\n    //         { name: 'Super Mario 64',\n    //           _id: 5150993001900a0000000001,\n    //           __v: 0,\n    //           tags: [ 'nintendo', 'mario', '3d' ] } } ],\n    //   stats:\n    //    { nscanned: 1,\n    //      nscannedObjects: 0,\n    //      n: 1,\n    //      nfound: 1,\n    //      timeMicros: 77 },\n    //   ok: 1 }\n  });\n});\n```\n\n### Output:\n\nThe output is not limited to the found documents themselves but also the complete details of the executed command.\n\nThe `results` property of the output is an array of objects containing the found document and its corresponding search ranking. `score` is the ranking, `obj` is the [mongoose document](http://mongoosejs.com/docs/documents.html).\n\nFor more information about these properties, read the [MongoDB documentation](http://docs.mongodb.org/manual/reference/text-search/#text-search-output).\n\n## Options\n\n`mongoose-text-search` supports passing an options object as the second argument.\n\n- `project`: select which [fields](http://docs.mongodb.org/manual/reference/command/text/) to return (mongoose [field selection](http://mongoosejs.com/docs/api.html#query_Query-select) syntax supported)\n- `filter`: declare an additional [query matcher](http://docs.mongodb.org/manual/reference/command/text/) using `find` syntax (arguments are cast according to the schema).\n- `limit`: [maximum number](http://docs.mongodb.org/manual/reference/command/text/) of documents (mongodb default is 100)\n- `language`: change the [search language](http://docs.mongodb.org/manual/reference/command/text/)\n\nExample:\n\n```js\nvar options = {\n    project: '-created' // do not include the `created` property\n  , filter: { likes: { $gt: 1000000 }}\n  , limit: 10\n  , language: 'spanish'\n}\n\nGame.textSearch('game -mario', options, callback);\n```\n\n## Notes:\n\nAs of mongoose 3.6.0, text indexes must be added using the [Schema.index()](http://mongoosejs.com/docs/api.html#schema_Schema-index) method.\n\nAs of MongoDB 2.4.0, [text search](http://docs.mongodb.org/manual/applications/text-search/) is experimental/beta. As such, this functionality is not in mongoose core.\n","scripts":{"test":"make test"},"_npmUser":{"name":"aaron","email":"aaron.heckmann+github@gmail.com"},"repository":{"url":"git://github.com/aheckmann/mongoose-text-search.git","type":"git"},"_npmVersion":"1.2.15","description":"MongoDB 2.4 text search for mongoose","directories":{},"readmeFilename":"README.md","devDependencies":{"mocha":"*","mongoose":"3.5.6"},"deprecated":"Unsupported"},"0.0.2":{"name":"mongoose-text-search","version":"0.0.2","keywords":["mongoose","text","search","plugin","mongodb","fulltext"],"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"license":"MIT","_id":"mongoose-text-search@0.0.2","maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"dist":{"shasum":"0bd54954584a011d25655de7a70674ad50bce19e","tarball":"https://registry.npmjs.org/mongoose-text-search/-/mongoose-text-search-0.0.2.tgz","integrity":"sha512-aB5l4IU45SZIn99S/X3qpsePXacWYreG/P20sIQXgSvg3wkn4jgo08A1iFv2sjRLKWDctJE/Kx72Lp8q90AGLQ==","signatures":[{"sig":"MEUCIAefsbTRt/2j7y7nMc/vtgTDKx13tblYbQwTXV93OcjbAiEAg3LAvKgUwRXdeVCbMaWfVYepYZ3q5SCBqfGp72ss9h4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","readme":"#mongoose-text-search\n======================\n\nProvides MongoDB 2.4 text search support for mongoose.\n\n[![Build Status](https://travis-ci.org/aheckmann/mongoose-text-search.png?branch=master)](https://travis-ci.org/aheckmann/mongoose-text-search)\n\n## Example:\n\n```js\n// modules\nvar mongoose = require('mongoose');\nvar textSearch = require('mongoose-text-search');\n\n// create our schema\nvar gameSchema = mongoose.Schema({\n    name: String\n  , tags: [String]\n  , likes: Number\n  , created: Date\n});\n\n// give our schema text search capabilities\ngameSchema.plugin(textSearch);\n\n// add a text index to the tags array\ngameSchema.index({ tags: 'text' });\n\n// test it out\nvar Game = mongoose.model('Game', gameSchema);\n\nGame.create({ name: 'Super Mario 64', tags: ['nintendo', 'mario', '3d'] }, function (err) {\n  if (err) return handleError(err);\n\n  Game.textSearch('3d', function (err, output) {\n    if (err) return handleError(err);\n\n    var inspect = require('util').inspect;\n    console.log(inspect(output, { depth: null }));\n\n    // { queryDebugString: '3d||||||',\n    //   language: 'english',\n    //   results:\n    //    [ { score: 1,\n    //        obj:\n    //         { name: 'Super Mario 64',\n    //           _id: 5150993001900a0000000001,\n    //           __v: 0,\n    //           tags: [ 'nintendo', 'mario', '3d' ] } } ],\n    //   stats:\n    //    { nscanned: 1,\n    //      nscannedObjects: 0,\n    //      n: 1,\n    //      nfound: 1,\n    //      timeMicros: 77 },\n    //   ok: 1 }\n  });\n});\n```\n\n### Output:\n\nThe output is not limited to the found documents themselves but also the complete details of the executed command.\n\nThe `results` property of the output is an array of objects containing the found document and its corresponding search ranking. `score` is the ranking, `obj` is the [mongoose document](http://mongoosejs.com/docs/documents.html).\n\nFor more information about these properties, read the [MongoDB documentation](http://docs.mongodb.org/manual/reference/text-search/#text-search-output).\n\n## Options\n\n`mongoose-text-search` supports passing an options object as the second argument.\n\n- `project`: select which [fields](http://docs.mongodb.org/manual/reference/command/text/) to return (mongoose [field selection](http://mongoosejs.com/docs/api.html#query_Query-select) syntax supported)\n- `filter`: declare an additional [query matcher](http://docs.mongodb.org/manual/reference/command/text/) using `find` syntax (arguments are cast according to the schema).\n- `limit`: [maximum number](http://docs.mongodb.org/manual/reference/command/text/) of documents (mongodb default is 100)\n- `language`: change the [search language](http://docs.mongodb.org/manual/reference/command/text/)\n- `lean`: Boolean: if true, documents are not cast to [mongoose documents](http://mongoosejs.com/docs/documents.html) (default false)\n\nExample:\n\n```js\nvar options = {\n    project: '-created'                // do not include the `created` property\n  , filter: { likes: { $gt: 1000000 }} // casts queries based on schema\n  , limit: 10\n  , language: 'spanish'\n  , lean: true\n}\n\nGame.textSearch('game -mario', options, callback);\n```\n\n## Notes:\n\nAs of mongoose 3.6.0, text indexes must be added using the [Schema.index()](http://mongoosejs.com/docs/api.html#schema_Schema-index) method.\n\nAs of MongoDB 2.4.0, [text search](http://docs.mongodb.org/manual/applications/text-search/) is experimental/beta. As such, this functionality is not in mongoose core.\n","scripts":{"test":"make test"},"repository":{"url":"git://github.com/aheckmann/mongoose-text-search.git","type":"git"},"description":"MongoDB 2.4 text search support for mongoose","directories":{},"devDependencies":{"mocha":"*","mongoose":"3.5.6"},"deprecated":"Unsupported"}},"time":{"created":"2013-03-26T19:16:54.423Z","modified":"2026-05-11T19:17:48.089Z","0.0.1":"2013-03-26T19:16:55.458Z","0.0.2":"2013-03-27T12:40:46.145Z"},"author":{"name":"Aaron Heckmann","email":"aaron.heckmann+github@gmail.com"},"repository":{"url":"git://github.com/aheckmann/mongoose-text-search.git","type":"git"},"description":"MongoDB 2.4 text search support for mongoose","keywords":["mongoose","text","search","plugin","mongodb","fulltext"],"license":"MIT","maintainers":[{"name":"aaron","email":"aaron.heckmann+github@gmail.com"}],"readme":"#mongoose-text-search\n======================\n\nProvides MongoDB 2.4 text search support for mongoose.\n\n[![Build Status](https://travis-ci.org/aheckmann/mongoose-text-search.png?branch=master)](https://travis-ci.org/aheckmann/mongoose-text-search)\n\n## Example:\n\n```js\n// modules\nvar mongoose = require('mongoose');\nvar textSearch = require('mongoose-text-search');\n\n// create our schema\nvar gameSchema = mongoose.Schema({\n    name: String\n  , tags: [String]\n  , likes: Number\n  , created: Date\n});\n\n// give our schema text search capabilities\ngameSchema.plugin(textSearch);\n\n// add a text index to the tags array\ngameSchema.index({ tags: 'text' });\n\n// test it out\nvar Game = mongoose.model('Game', gameSchema);\n\nGame.create({ name: 'Super Mario 64', tags: ['nintendo', 'mario', '3d'] }, function (err) {\n  if (err) return handleError(err);\n\n  Game.textSearch('3d', function (err, output) {\n    if (err) return handleError(err);\n\n    var inspect = require('util').inspect;\n    console.log(inspect(output, { depth: null }));\n\n    // { queryDebugString: '3d||||||',\n    //   language: 'english',\n    //   results:\n    //    [ { score: 1,\n    //        obj:\n    //         { name: 'Super Mario 64',\n    //           _id: 5150993001900a0000000001,\n    //           __v: 0,\n    //           tags: [ 'nintendo', 'mario', '3d' ] } } ],\n    //   stats:\n    //    { nscanned: 1,\n    //      nscannedObjects: 0,\n    //      n: 1,\n    //      nfound: 1,\n    //      timeMicros: 77 },\n    //   ok: 1 }\n  });\n});\n```\n\n### Output:\n\nThe output is not limited to the found documents themselves but also the complete details of the executed command.\n\nThe `results` property of the output is an array of objects containing the found document and its corresponding search ranking. `score` is the ranking, `obj` is the [mongoose document](http://mongoosejs.com/docs/documents.html).\n\nFor more information about these properties, read the [MongoDB documentation](http://docs.mongodb.org/manual/reference/text-search/#text-search-output).\n\n## Options\n\n`mongoose-text-search` supports passing an options object as the second argument.\n\n- `project`: select which [fields](http://docs.mongodb.org/manual/reference/command/text/) to return (mongoose [field selection](http://mongoosejs.com/docs/api.html#query_Query-select) syntax supported)\n- `filter`: declare an additional [query matcher](http://docs.mongodb.org/manual/reference/command/text/) using `find` syntax (arguments are cast according to the schema).\n- `limit`: [maximum number](http://docs.mongodb.org/manual/reference/command/text/) of documents (mongodb default is 100)\n- `language`: change the [search language](http://docs.mongodb.org/manual/reference/command/text/)\n\nExample:\n\n```js\nvar options = {\n    project: '-created' // do not include the `created` property\n  , filter: { likes: { $gt: 1000000 }}\n  , limit: 10\n  , language: 'spanish'\n}\n\nGame.textSearch('game -mario', options, callback);\n```\n\n## Notes:\n\nAs of mongoose 3.6.0, text indexes must be added using the [Schema.index()](http://mongoosejs.com/docs/api.html#schema_Schema-index) method.\n\nAs of MongoDB 2.4.0, [text search](http://docs.mongodb.org/manual/applications/text-search/) is experimental/beta. As such, this functionality is not in mongoose core.\n","users":{"fmm":true,"hagb4rd":true,"elrolito":true,"hoitmort":true,"mhaidarh":true,"santihbc":true,"anmol1771":true,"developit":true,"mr-smiley":true,"rajkumarbe":true,"masanorinyo":true,"martinspinks":true,"markthethomas":true,"faisal.al.tameemi":true}}