{"_id":"reds","_rev":"43-aff9f2bbdc51a32379b9a07882957d35","name":"reds","description":"Redis search for node.js","dist-tags":{"latest":"1.0.0"},"versions":{"0.0.1":{"name":"reds","version":"0.0.1","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.0.27","redis":"0.6.6"},"devDependencies":{"should":"0.2.1"},"main":"index","engines":{"node":"0.4.x"},"_npmJsonOpts":{"file":"/Users/tj/.npm/reds/0.0.1/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"reds@0.0.1","_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"5cc2d5746d42db38b6c32e0e7c1bb2bc9d5f4744","tarball":"https://registry.npmjs.org/reds/-/reds-0.0.1.tgz","integrity":"sha512-d88bABm7potxv0YVxvDrvJiwwXnJ58nSLOZGPPkUQjTqyuClINuagcKY9TBlXkMLYFVMdkZHXg8Equp6m9bEqA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCoCJq2jLKGL/tS7VizYo8onHVbt27TVafSjVMj0TIKEwIhAPJG3LG/mHR0C8SIlTliCQMT5tlOVBdrYH7i8Lc5L8DG"}]},"scripts":{}},"0.0.2":{"name":"reds","version":"0.0.2","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.0.27","redis":"0.6.6"},"devDependencies":{"should":"0.2.1","uubench":">= 0.0.1"},"main":"index","engines":{"node":"0.4.x"},"_npmJsonOpts":{"file":"/Users/tj/.npm/reds/0.0.2/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"reds@0.0.2","_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"f60df4f10afe25511aae626cf5813d80759861fc","tarball":"https://registry.npmjs.org/reds/-/reds-0.0.2.tgz","integrity":"sha512-HlSGS701Prcv5fDaIa1Q8ApQ4+wn7WuoFlh/PLSf985WnjGWRZxStbp7MSI6RzgIbLvZxvsu7y4Hb7QHvg07yg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb2ky7+7vFzyTISvPYSPT7E9aYymPi0UW2tQI7Cv6CdQIgTie9b/QWV0BgU9YxBRl4z8deTJRdj3C3sqehFvVTnQE="}]},"scripts":{}},"0.0.3":{"name":"reds","version":"0.0.3","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.0.27","redis":"0.6.6"},"devDependencies":{"should":"0.2.1","uubench":">= 0.0.1"},"main":"index","engines":{"node":"0.4.x"},"_npmJsonOpts":{"file":"/Users/tj/.npm/reds/0.0.3/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"reds@0.0.3","_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"b46632758230e0a7f29fea2da214cfe6b30ae760","tarball":"https://registry.npmjs.org/reds/-/reds-0.0.3.tgz","integrity":"sha512-dmzLvJkHyyoOeQ8ZBee2pRYZ0sREOatL475Q8D9iVCRPb9oGSncsHQ4u4mMGZDOGdGrxGlm2YVnY9RMHwIWrag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOzatFkro9o/LxKb1Hubi2MMrqI4rPrJY/l1y3ilBvrwIhAOkr0deqWksx+9Wy2K6JPTSJ1GXa2eiokLjCf939ZoUd"}]},"scripts":{}},"0.1.0":{"name":"reds","version":"0.1.0","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.0.27","redis":"0.6.6"},"devDependencies":{"should":"0.2.1","uubench":">= 0.0.1","superagent":">= 0.0.1"},"main":"index","engines":{"node":"0.4.x"},"_npmJsonOpts":{"file":"/Users/tj/.npm/reds/0.1.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"reds@0.1.0","_engineSupported":true,"_npmVersion":"1.0.14","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"f9ab94909a02518603871d94162ead75430e017f","tarball":"https://registry.npmjs.org/reds/-/reds-0.1.0.tgz","integrity":"sha512-ivqL8QSGCvMcF5Fwnwc1RBfbsjhKIdY/wx4MclZeOAQ8YbBMziQQPWsozEgx8Hm7jsJtRiPaH0SIdc5bZ6yGcg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCAnF0jRDmkMiISd4e8yzkokIUbXu5qyP2U7dC9gY/iHwIhAMrVXliwlzWN116oVGojPBHsYRoETK+XemvySwpD0bsR"}]},"scripts":{}},"0.1.1":{"name":"reds","version":"0.1.1","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.0.27","redis":">= 0.6.6"},"devDependencies":{"should":"0.2.1","uubench":">= 0.0.1","superagent":">= 0.0.1"},"main":"index","engines":{"node":">= 0.4.0 < 0.7.0"},"_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"_id":"reds@0.1.1","_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"5a468d234c585a486e2cb6cfdda853a16306f264","tarball":"https://registry.npmjs.org/reds/-/reds-0.1.1.tgz","integrity":"sha512-GJ2/RjObq0+dJVatV4UU2Wj/sPrFiPuhuO/bhyK/k1tcIBvHzrb4kGsXAmeQ6fV9fbnWtFKuqWGWd6hJTxHGbQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFViC9gvUA49Gp7CgLSOWJfw6RQh1SY9iXG+rlamcKTQIgfnl3g1s88wz6EXWBZf0PtLUpLSivtQFNSdB0nVbDNRA="}]},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}]},"0.1.2":{"name":"reds","version":"0.1.2","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.0.64","redis":">= 0.6.6"},"devDependencies":{"should":"*","uubench":"*","superagent":"*"},"main":"index","engines":{"node":">= 0.4.0 < 0.7.0"},"_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"_id":"reds@0.1.2","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"3f284cb37a2b51d82943c54d624b95f84db561a5","tarball":"https://registry.npmjs.org/reds/-/reds-0.1.2.tgz","integrity":"sha512-gUasPi0II+1lM/19XuHVcX0y2AXX3iAagsa/AD2oOmbHjv8648ahBXOqhuXLP81fZNrZXu2t0DjJS7MdGMw0tA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDMC7dTpZgcfK4sjTH9gfNEl/Gl3kRJWYXazHkwAi/LWgIgcEH3Vw0f+O4iejEi9nZn4pKlp4lXLaYx+vqI03xs4NA="}]},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}]},"0.1.3":{"name":"reds","version":"0.1.3","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.0.69","redis":"0.7.1"},"devDependencies":{"should":"*","uubench":"*","superagent":"*","mocha":"*"},"main":"index","engines":{"node":">= 0.4.0 < 0.7.0"},"_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"_id":"reds@0.1.3","_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"123092c759731e8e7d9129ec0511aa175b82ea09","tarball":"https://registry.npmjs.org/reds/-/reds-0.1.3.tgz","integrity":"sha512-UJj8tNB0iXJdnfXx+55PrKxf2aiMFAVahD88VGP4rixpE0oJhW1wlFamDZOB0SIWOgHrC+OAyoCUpyxoLnjx0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAsHDx1Zz4vSYOMWUipeN09BUoirMJtQqLOnpsuVy63xAiEAl75qzgGBk9MmaSKbHAHe7b2aSNXaO9grxkrOEvsr8UU="}]},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}]},"0.1.4":{"name":"reds","version":"0.1.4","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.0.69","redis":">= 0.6.6"},"devDependencies":{"should":"*","uubench":"*","superagent":"*"},"main":"index","_id":"reds@0.1.4","dist":{"shasum":"a97819180c30f6ecd01cad03cecb574eaabb4bee","tarball":"https://registry.npmjs.org/reds/-/reds-0.1.4.tgz","integrity":"sha512-0vXFMuOc53OgMszLoglJjhz11bQ5QP3xP7Q8mSbskwgwVSN8odoirgM3sjYIVfkfzJo8jUZAPAw64ZgobYFvEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCJKCnDGdLIuDwZ0+cKqWN+6AsIbGjcCRFL1/e66loJ9QIhAPslJV332InUJvSuMVA64wT/saLmKbSswsfOea1uFkOV"}]},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}]},"0.2.1":{"name":"reds","version":"0.2.1","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.1.15","redis":"0.7.2"},"devDependencies":{"should":"*","uubench":"*","superagent":"*"},"main":"index","_id":"reds@0.2.1","dist":{"shasum":"c940243db98f744b6acf7a14560ef44f4c452741","tarball":"https://registry.npmjs.org/reds/-/reds-0.2.1.tgz","integrity":"sha512-7TyQfDX4MUMlWCxJ8vAL0cTEyfno7/r++hnrmeDYDL5YYGpN6cEHkFzQNqNxfqJmJrPNHrI0FY2+rv7xKAsyzA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoOIEj5IDYDWyAT63QuBWMZYKm4LTjvBe3zIABPjRUawIhAJTTeDJj1iE+dotxBWyEFhXBpZnOWhJGPGUyviPhvvTC"}]},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}]},"0.2.2":{"name":"reds","version":"0.2.2","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.1.17","redis":"0.7.2"},"devDependencies":{"should":"*","uubench":"*","superagent":"*"},"main":"index","_id":"reds@0.2.2","dist":{"shasum":"b9698167fdf23aecfed07fdefcfda5210fc72fab","tarball":"https://registry.npmjs.org/reds/-/reds-0.2.2.tgz","integrity":"sha512-GS3BdT/HyG7JMkSjkcYaGewZIO1/iEmnnOvIDg4n7ikOgnw0UDm264CXRiv/yZIXT9MLDDDJU1c5+UIS1DzRlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/TkglEpZvqjQaz7TSOGIMao0gPsLYF1qC8/22bNfXIAIhAM2+pSr0Zj2C96BvBqA8+LoGn5xZxLTnITi0nbfyfKI0"}]},"_npmVersion":"1.1.61","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}]},"0.2.3":{"name":"reds","version":"0.2.3","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.1.17","redis":"0.7.2"},"devDependencies":{"should":"*","uubench":"*","superagent":"*"},"main":"index","_id":"reds@0.2.3","dist":{"shasum":"9f10eb95fd4366b6df1389ad5a736771fc10681d","tarball":"https://registry.npmjs.org/reds/-/reds-0.2.3.tgz","integrity":"sha512-FfkGp+vV3gBgisNj3dfagESgGDNca8NPC1PbhxWWljyUt8+vUkCFrlklEzaTBbIKD4zGgGxedFLCFElp433iig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDT3WrDZbE5KF+g8aKmDcdr6iRWNTNI777d6X9xBXDf7AiEAqF/EkswAcuu+3skjqB5tRyWy5Ek6v5awjqV3yUyICqo="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}]},"0.2.4":{"name":"reds","version":"0.2.4","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.1.17","redis":"0.7.2"},"devDependencies":{"should":"*","uubench":"*","superagent":"*"},"main":"index","_id":"reds@0.2.4","dist":{"shasum":"a82dcaaa52319635bc6eee3ef9c1ac074411de3c","tarball":"https://registry.npmjs.org/reds/-/reds-0.2.4.tgz","integrity":"sha512-42o3awrzAg0ci5voztNdtV/q6GWmzawsaoNzRBZXcB1KC3+gQBiEi+wlXvUIW4LfEolQaKUygUtnv0WoJIqeQg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDdhPEoD4POHfmstEw0mq6ZP4Qdy405erKFK11xvaXcTAiEAwwKbYQm/CY8IN82R/91fZdu0U9dUU78sbHMGCRGBVZ0="}]},"_from":".","_npmVersion":"1.3.4","_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"}]},"0.2.5":{"name":"reds","version":"0.2.5","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"^0.2.0","redis":"^0.12.1"},"devDependencies":{"matcha":"^0.6.0","should":"^3.3.2","superagent":"^0.21.0"},"main":"index","repository":{"type":"git","url":"https://github.com/visionmedia/reds.git"},"gitHead":"a36d0ea6b62eb8bc7df6ebec8ae86ec148413262","bugs":{"url":"https://github.com/visionmedia/reds/issues"},"homepage":"https://github.com/visionmedia/reds","_id":"reds@0.2.5","scripts":{},"_shasum":"38a767f7663cd749036848697d82c74fd29bc01f","_from":".","_npmVersion":"2.2.0","_nodeVersion":"1.0.3","_npmUser":{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"stockholmux","email":"kyle@higheredcareers.ca"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"}],"dist":{"shasum":"38a767f7663cd749036848697d82c74fd29bc01f","tarball":"https://registry.npmjs.org/reds/-/reds-0.2.5.tgz","integrity":"sha512-3QlVQio4LFrkmzwMOmTVI+hxZm9PxOzUPeZkXkVXJDbPXCZKIWEklTDgB9ZWOPWj4gT6vI4OAfw64tsyw2OJ1w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEKur44QH0QXoIRCRIyYld1EUSg5gAG99oHk2D278fUSAiEAsXE70qzrTFzaV95GUM2DBO6enusjpSG09p0jyFJErjU="}]}},"1.0.0":{"name":"reds","version":"1.0.0","description":"Redis search for node.js","keywords":["redis","search","metaphone","phonetics","natural"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"dependencies":{"natural":"0.5.0","redis":"^2.7.1"},"devDependencies":{"yargs":"^7.0.2","async":"^2.3.0","matcha":"^0.6.0","should":"^3.3.2","superagent":"^0.21.0"},"main":"index","repository":{"type":"git","url":"git+https://github.com/visionmedia/reds.git"},"gitHead":"d71c48e14c37544327bcc1e39ddf1fbbc4be9205","bugs":{"url":"https://github.com/visionmedia/reds/issues"},"homepage":"https://github.com/visionmedia/reds#readme","_id":"reds@1.0.0","scripts":{},"_shasum":"e96db361a8302cb1e75d217a0332aab6b98e1fa8","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.4","_npmUser":{"name":"stockholmux","email":"kyle@higheredcareers.ca"},"dist":{"shasum":"e96db361a8302cb1e75d217a0332aab6b98e1fa8","tarball":"https://registry.npmjs.org/reds/-/reds-1.0.0.tgz","integrity":"sha512-Aq+8pBhJQwGW2AzH7wA+Gzm05t0hGmkipDutgoZzlrH+B9OORQm4DZcX64A6thJQF+AX1l6PxR3mSf4gPOZskQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAkLrehNRTjx/gfvC/dZhCv0vSW8RH2CUSdd48nY8qthAiB74bRloGTQb19Q3+gMGfSwhsfmMbq6YOlwRq7mqN3U9A=="}]},"maintainers":[{"name":"tjholowaychuk","email":"tj@vision-media.ca"},{"name":"stockholmux","email":"kyle@higheredcareers.ca"},{"name":"jonathanong","email":"jonathanrichardong@gmail.com"},{"name":"jongleberry","email":"jonathanrichardong@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/reds-1.0.0.tgz_1492545275637_0.9710880061611533"}}},"maintainers":[{"email":"kyle@kylejdavis.com","name":"stockholmux"},{"email":"jonathanrichardong@gmail.com","name":"jonathanong"},{"email":"jonathanrichardong@gmail.com","name":"jongleberry"},{"email":"tj@vision-media.ca","name":"tjholowaychuk"}],"time":{"modified":"2022-06-26T09:53:37.949Z","created":"2011-07-28T00:29:57.652Z","0.0.1":"2011-07-28T00:29:58.302Z","0.0.2":"2011-07-28T01:46:29.859Z","0.0.3":"2011-07-28T02:01:55.996Z","0.1.0":"2011-07-28T16:12:52.609Z","0.1.1":"2011-11-16T16:38:08.392Z","0.1.2":"2012-01-31T01:07:20.398Z","0.1.3":"2012-03-14T15:42:14.641Z","0.1.4":"2012-06-28T16:17:15.365Z","0.2.1":"2012-09-05T23:00:25.381Z","0.2.2":"2012-10-08T22:09:08.147Z","0.2.3":"2013-02-22T20:50:18.383Z","0.2.4":"2013-08-10T09:42:00.426Z","0.2.5":"2015-01-21T05:36:51.535Z","1.0.0":"2017-04-18T19:54:37.652Z"},"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"users":{"tjholowaychuk":true,"nex":true,"jpepe":true,"xueboren":true,"antaranian":true,"bhedge":true},"keywords":["redis","search","metaphone","phonetics","natural"],"readme":"# reds\n\n  reds is a light-weight Redis search for node.js. This module was originally developed to provide search capabilities for [Kue](http://automattic.github.io/kue/) a priority job queue, however it is very much a light general purpose search library that could be integrated into a blog, a documentation server, etc.\n\n## Upgrading\n\nVersion 1.0.0 is syntactically compatible with previous versions of reds (0.2.5). However, [natural](https://github.com/NaturalNode/natural) has been updated. Documents indexed with older installs of reds (using natural v0.2.0) may need to be re-indexed to avoid some edge cases.\n\n## Installation\n\n      $ npm install reds\n\n## Example\n\nThe first thing you'll want to do is create a `Search` instance, which allows you to pass a `key`, used for namespacing within Redis so that you may have several searches in the same db. You may specify your own [node_redis](https://github.com/NodeRedis/node_redis) instance with the `reds.setClient` function.\n\n    var search = reds.createSearch('pets');\n\n reds acts against arbitrary numeric or string based ids, so you could utilize this library with essentially anything you wish, even combining data stores. The following example just uses an array for our \"database\", containing some strings, which we add to reds by calling `Search#index()` padding the body of text and an id of some kind, in this case the index.\n\n```js\nvar strs = [];\nstrs.push('Tobi wants four dollars');\nstrs.push('Tobi only wants $4');\nstrs.push('Loki is really fat');\nstrs.push('Loki, Jane, and Tobi are ferrets');\nstrs.push('Manny is a cat');\nstrs.push('Luna is a cat');\nstrs.push('Mustachio is a cat');\n\nstrs.forEach(function(str, i){ search.index(str, i); });\n```\n\n To perform a query against reds simply invoke `Search#query()` with a string, and pass a callback, which receives an array of ids when present, or an empty array otherwise.\n\n```js\nsearch\n  .query(query = 'Tobi dollars')\n  .end(function(err, ids){\n    if (err) throw err;\n    console.log('Search results for \"%s\":', query);\n    ids.forEach(function(id){\n      console.log('  - %s', strs[id]);\n    });\n    process.exit();\n  });\n  ```\n\n By default reds performs an intersection of the search words. The previous example would yield the following output since only one string contains both \"Tobi\" _and_ \"dollars\":\n\n```\nSearch results for \"Tobi dollars\":\n  - Tobi wants four dollars\n```\n\n We can tweak reds to perform a union by passing either \"union\" or \"or\" to `Search#type()` in `reds.search()` between `Search#query()` and `Search#end()`, indicating that _any_ of the constants computed may be present for the id to match.\n\n```js\nsearch\n  .query(query = 'tobi dollars')\n  .type('or')\n  .end(function(err, ids){\n    if (err) throw err;\n    console.log('Search results for \"%s\":', query);\n    ids.forEach(function(id){\n      console.log('  - %s', strs[id]);\n    });\n    process.exit();\n  });\n```\n\n The union search would yield the following since three strings contain either \"Tobi\" _or_ \"dollars\":\n\n```\nSearch results for \"tobi dollars\":\n  - Tobi wants four dollars\n  - Tobi only wants $4\n  - Loki, Jane, and Tobi are ferrets\n```\n\n## API\n\n```js\nreds.createSearch(key)\nSearch#index(text, id[, fn])\nSearch#remove(id[, fn]);\nSearch#query(text, fn[, type]);\n```\n\n Examples:\n\n```js\nvar search = reds.createSearch('misc');\nsearch.index('Foo bar baz', 'abc');\nsearch.index('Foo bar', 'bcd');\nsearch.remove('bcd');\nsearch.query('foo bar').end(function(err, ids){});\n```\n\n## Extending reds\n\nStarting in 1.0.0, you can easily extend and expand how reds functions. When creating a new search, supply an object as the second argument. There are currently three properties that can be configured:\n\n- `nlpProcess` the natural language processing function. You can alter how the words are processed (split, stemmed, and converted to metaphones) using this function.\n- `writeIndex` how the items are written to the index. \n- `removeIndex` how the items are removed from the index.\n\nSee the `lib/reds.js` file for the implementation of each. Please keep in mind that changing these functions may invalidate your previously stored index.\n\n```js\nreds.createSearch('pets', {\n  nlpProcess  : yourNlpProcessingFunction,\n  writeIndex  : yourWriteIndexFunction,\n  removeIndex : yourRemoveIndexFunction\n});\n```\n\n## About\n\n  Currently reds strips stop words and applies the metaphone and porter stemmer algorithms to the remaining words before mapping the constants in Redis sets. For example the following text:\n\n    Tobi is a ferret and he only wants four dollars\n\n  Converts to the following constant map:\n  \n```js\n{\n  Tobi: 'TB',\n  ferret: 'FRT',\n  wants: 'WNTS',\n  four: 'FR',\n  dollars: 'DLRS'\n}\n```\n\n This also means that phonetically similar words will match, for example \"stefen\", \"stephen\", \"steven\" and \"stefan\" all resolve to the constant \"STFN\". Reds takes this further and applies the porter stemming algorithm to \"stem\" words, for example \"counts\", and \"counting\" become \"count\".\n\n Consider we have the following bodies of text:\n\n    Tobi really wants four dollars\n    For some reason tobi is always wanting four dollars\n\n The following search query will then match _both_ of these bodies, and \"wanting\", and \"wants\" both reduce to \"want\".\n\n    tobi wants four dollars\n\n## Benchmarks\n\n Nothing scientific but preliminary benchmarks show that a small 1.6kb body of text is currently indexed in ~__6ms__, or __163__ ops/s. Medium bodies such as 40kb operate around __6__ ops/s, or __166ms__.\n\n Querying with a multi-word phrase, and an index containing ~3500 words operates around __5300__ ops/s. Not too bad.\n \n If working with massive documents, you may want to consider adding a \"keywords\" field, and simply indexing it's value instead of multi-megabyte documents.\n\n## License \n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","readmeFilename":"Readme.md","homepage":"https://github.com/visionmedia/reds#readme","repository":{"type":"git","url":"git+https://github.com/visionmedia/reds.git"},"bugs":{"url":"https://github.com/visionmedia/reds/issues"}}