{"_id":"flo","_rev":"7-fbaee2db1c66792de56a80112967684f","name":"flo","description":"Redis powered node.js autocompleter inspired by soulmate","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"flo","description":"Redis powered node.js autocompleter inspired by soulmate","version":"0.1.0","author":{"name":"Teng Siong Ong","email":"siong1987@gmail.com"},"dependencies":{"redis":">= 0.6.7","async":"0.1.9","underscore":">= 1.1.7"},"devDependencies":{"expresso":"0.8.1","should":"0.2.1","express":"2.4.3"},"keywords":["autocompleter","soulmate","redis","flo"],"repository":{"type":"git","url":"git://github.com/FLOChip/flo.git"},"main":"index","engines":{"node":">= 0.4.9 < 0.7.0"},"_npmJsonOpts":{"file":"/Users/siong1987/.npm/flo/0.1.0/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"flo@0.1.0","_engineSupported":true,"_npmVersion":"1.0.22","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"b074728f5dce7b1ee419ce27ad690152843b5318","tarball":"https://registry.npmjs.org/flo/-/flo-0.1.0.tgz","integrity":"sha512-/+zWHODBJZR//6xwFDwdDa0pU2n1FL/yTYLWbKamWgKcm/autFIwBXbl8ANMc9JBOrPaIQZGLvvJHfxeTZ/oFw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC8khnoOngGzQ/Hp8MfO5p/kqoOfy79oxPrbiUbwAuiWwIgJUIApSKykLkjuis7Dbr3DCs6Y0Qy7RWPDhFCmClSByE="}]},"scripts":{},"maintainers":[{"name":"siong1987","email":"siong1987@gmail.com"}]},"0.2.0":{"name":"flo","description":"Redis powered node.js autocompleter inspired by soulmate","version":"0.2.0","author":{"name":"Teng Siong Ong","email":"siong1987@gmail.com"},"dependencies":{"redis":">= 0.6.7","async":"0.1.9","underscore":">= 1.1.7"},"devDependencies":{"expresso":"0.8.1","should":"0.2.1","express":"2.4.3"},"keywords":["autocompleter","soulmate","redis","flo"],"repository":{"type":"git","url":"git://github.com/FLOChip/flo"},"main":"index","engines":{"node":">= 0.4.9 < 0.7.0"},"readme":"flo\n===\n**flo** is a [redis](http://redis.io) powered [node.js](http://nodejs.org) autocompleter inspired by [soulmate](https://github.com/seatgeek/soulmate). You can use this anywhere you want since this is just a module. If you look into the examples folder, I have provided an example on how to get it work with [express](http://expressjs.com/).\n\nIf you want see a real world example of this, you should try out the search box at [SeatGeek](http://seatgeek.com) or [Quora](http://quora.com).\n\nDocumentations\n==============\n\nFirst, connect to the redis instance:\n\nSets up a new Redis Connection.\n\n    var flo = require('flo').connect();\n\noptions - Optional Hash of options.\n\n* `redis`       - An existing redis connection to use.\n* `host`        - String Redis host. (Default: Redis' default)\n* `port`        - Integer Redis port. (Default: Redis' default)\n* `password`    - String Redis password.\n* `namespace`   - String namespace prefix for Redis keys. (Default: flo).\n* `mincomplete` - Minimum completion of keys required for auto completion. (Default: 1)\n* `database`    - Integer of the Redis database to select.\n\nReturns a Connection instance.\n\nThese are the public functions:\n\nAdd a new term\n--------------\n\n`add_term(type, id, term, score, data, callback)`:\n\n* `type`     - the type of data of this term (String)\n* `id`       - unique identifier(within the specific type)\n* `term`     - the phrase you wish to provide completions for\n* `score`    - user specified ranking metric (redis will order things lexicographically for items with the same score)\n* `data`     - container for metadata that you would like to return when this item is matched (optional)\n* `callback` - callback to be run (optional)\n\nReturns nothing.\n\nSearch for a term\n-----------------\n\n`search_term(types, phrase, limit, callback)`:\n\n* `types` - types of term that you are looking for (Array of String)\n* `phrase` - the phrase or phrases you want to be autocompleted\n* `limit` - the count of the number you want to return (optional, default: 5)\n* `callback(err, result)` - err is the error and results is the results\n\nThis call:\n\n`search_term([\"chinese\", \"indian\"], \"rice\", 1, cb);`\n\nwill return a result in json format like:\n\n    {\n      term: \"rice\"\n      chinese: [\n          {\n            id: 3,\n            term: \"mongolian fried rice\",\n            score: 10,\n            data: {\n              name: \"Gonghu Chinese Restaurant\",\n              address: \"304, University Avenue, Palo Alto\"\n            }\n          }\n        ],\n       indian: [\n          {\n            id: 1,\n            term: \"Briyani Chicken Rice\",\n            score: 5,\n            data: {\n              name: \"Bombay Grill\",\n              address: \"100 Green St, Urbana\"\n            }\n          }\n        ]\n    }\n\nRemove a term\n-------------\n\n`remove_term(type, id, callback)`:\n\n* `type`     - the type of data of this term (String)\n* `id`       - unique identifier(within the specific type)\n* `callback` - callback to be run (optional)\n\nReturns nothing.\n\nGet the IDs for a term\n----------------------\n\n`get_ids (type, term, callback)`:\n\n* `type`    - the type of data for this term\n* `term`    - the term to find the unique identifiers for\n* `callback(err, result)` - result is an array of IDs for the term.  Empty array if none were found\n\nGet the data for an ID\n-----------------------\n\n`get_data(type, id, callback)`:\n\n* `type`    - the type of data for this term\n* `id`       - unique identifier (within the specific type)\n* `callback(err, result)` - result is the data\n\nFor more information, you can read it [here](https://github.com/siong1987/flo/tree/master/docs).\n\n## Tests\nTo run tests, first make sure your local redis is running, then:\n\n    ./node_modules/expresso/bin/expresso test/*.test.js\n\n### License\n[MIT License](https://github.com/siong1987/flo/blob/master/LICENSE)\n\n---\n### Author\n[Teng Siong Ong](https://github.com/siong1987/)\n\n### Company\n[FLOChip](http://flochip.com)\n","_id":"flo@0.2.0","dist":{"shasum":"78b52ffa625114e39d3014c699b4c8d685009feb","tarball":"https://registry.npmjs.org/flo/-/flo-0.2.0.tgz","integrity":"sha512-17X/fY3uyd7K5qaQcKmzvUIM1SYJPrkjaggZAdH5msRbqnJ/CCMQVJ2cjVQ4Ev1AVulMNJ5lE0j6eL5JKItKfQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD2JkHnjG1pb8CPvW4SsOOMmToOGMrWZTH2cf0c7eBk+QIgB6wdvYvBjQLbG/Zv40aZAid8oozFk/yIlj9Q4pbLkv0="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"siong1987","email":"siong1987@gmail.com"},"maintainers":[{"name":"siong1987","email":"siong1987@gmail.com"}]}},"maintainers":[{"name":"siong1987","email":"siong1987@gmail.com"}],"time":{"modified":"2022-06-18T02:13:08.850Z","created":"2011-09-10T23:21:22.977Z","0.1.0":"2011-09-10T23:21:43.827Z","0.2.0":"2012-10-06T00:31:53.190Z"},"author":{"name":"Teng Siong Ong","email":"siong1987@gmail.com"},"repository":{"type":"git","url":"git://github.com/FLOChip/flo"}}