https://github.com/redisearch/redisearch-beer
RediSearch demo with beer
https://github.com/redisearch/redisearch-beer
redisearch
Last synced: about 1 year ago
JSON representation
RediSearch demo with beer
- Host: GitHub
- URL: https://github.com/redisearch/redisearch-beer
- Owner: RediSearch
- License: bsd-3-clause
- Created: 2019-05-31T02:09:21.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2024-02-23T04:51:02.000Z (over 2 years ago)
- Last Synced: 2025-04-20T12:41:14.280Z (about 1 year ago)
- Topics: redisearch
- Language: Python
- Homepage: https://redisearch.io/
- Size: 633 KB
- Stars: 6
- Watchers: 2
- Forks: 7
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/RediSearch/redisearch-beer/actions)
# rediseach-beer
Demo for RediSearch using the https://openbeerdb.com/ dataset.
## Running the Demo
To run the demo:
```
$ git clone https://github.com/RediSearch/redisearch-beer.git
$ cd redisearch-beer
$ docker-compose up
```
If something went wrong, you might need to force docker-compose to rebuild the containers
```
$ docker-compose up --force-recreate --build
```
Open a second terminal to connect to redis and explore the dataset:
```
$ redis-cli
```
## Example Queries
After the data is imported, you can query it using RediSearch. Some example commands:
Irish Ale and German Ale beers with ABV greater than 9%:
```
FT.SEARCH beerIdx "@category:Irish Ale|German Ale @abv:[9 inf]"
```
All beers with ABV higher than 5% but lower than 6%:
```
FT.SEARCH beerIdx "@abv:[5 6]"
```
Breweries in a 10km radius of the coordinates of Chicago, IL USA:
```
FT.SEARCH breweryIdx "@location:[-87.623177 41.881832 10 km]"
```
## Frontend
There is a rudimentary flask front end to show search functionality. To access the UI, point your web browser at http://localhost:5000/
## Notes
- The beers are added to the RediSearch index weighted by ABV. So by default, the results will be ordered by ABV highest to lowest. Both ABV and IBU are sortable, so you can order results by either of these fields using `sortby` in the query.
- The csv files are available on the openbeerdb.com site, but a small change the [beers.csv](../master/beerloader/data/beers.csv) file because it was malformed. Hence they are part of this repo.