Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/poga/redis-rating
A Redis module that helps you calculate the real rating from positive/negative rating feedback.
https://github.com/poga/redis-rating
Last synced: about 2 months ago
JSON representation
A Redis module that helps you calculate the real rating from positive/negative rating feedback.
- Host: GitHub
- URL: https://github.com/poga/redis-rating
- Owner: poga
- License: mit
- Created: 2017-07-29T05:51:09.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2017-07-31T21:06:59.000Z (about 7 years ago)
- Last Synced: 2024-04-15T09:20:09.822Z (5 months ago)
- Language: Rust
- Size: 17.6 KB
- Stars: 19
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# redis-rating
A Redis module that helps you calculate the real rating from positive/negative rating feedbacks.
The blog post [how not to sort by average rating](http://www.evanmiller.org/how-not-to-sort-by-average-rating.html) described the algorithm we use.
## Install
Build from source:
```
$ git clone https://github.com/poga/redis-rating.git
$ cd redis-rating
$ cargo build --release
$ cp target/release/libredis_rating.dylib /path/to/modules/
```Run Redis pointing to the newly built module:
```
redis-server --loadmodule /path/to/modules/libredis_rating.so
```Alternatively add the following to a `redis.conf` file:
```
loadmodule /path/to/modules/libredis_rating.so
```## Usage
### RT.RATEPOS
```
RT.RATEPOS []
```Add `count` positive rating to `key`. `count` is default to 1.
#### Response
The command will respond with an array of integers. The first integer is the total number of positive votes. The second integer is the total number of votes.
### RT.RATENEG
```
RT.RATEPOS []
```Add `count` negative rating to `key`. `count` is default to 1.
#### Response
The command will respond with an array of integers. The first integer is the total number of positive votes. The second integer is the total number of votes.
### RT.GET
```
RT.RATEPOS
```Estimate the **Real** rating of the given key. `Rating = Lower bound of Wilson score confidence interval for a Bernoulli parameter`
#### Response
Returns a double, which is the estimated rating of the key.
## License
This module is based on brandur's [redis-cell](https://github.com/brandur/redis-cell).
The following files is copied from brandur's project with minor modification. Therefore preserve the original [license](https://github.com/brandur/redis-cell/blob/master/LICENSE)
```
The MIT License, Copyright (c) 2016 Brandur and contributors
* `src/redis/*`
* `src/error.rs`
* `src/marcos.rs`
* `build.rs`
```Everything else is licensed under The MIT License (Chieh Po).