Closed simonprickett closed 2 years ago
Can I hop on this?
Yes @teezzan :) Please check out our guidelines at developer.redis.com/hacktoberfest and we look forward to seeing something from you in a couple of days :)
@teezzan hope all is well. Let us know if you need help or advice here.
I'm sorry. I am starting ~tomorrow~ now. Thanks for checking on me.
This application stores its station data in two places... a Redis geo key containing all stations, and a series of Redis Hashes - one for each station. Currently, the application does nothing with the data in the Hashes whose keys are of the form
station:<stationName>
.Here's Ashby for example:
Update the application to use RediSearch as follows:
docker-compose.yml
from the currentredis:6.2.1-alpine
image to instead use the latest RediSearch container: https://hub.docker.com/r/redislabs/redisearchload_stations.py
. Give your index the nameidx:stations
- you'll need to index the City field of hashes whose keys begin with the prefixstation:*
. Use the RediSearch library for this https://pypi.org/project/redisearch/ (note you are working with RediSearch 2 here)app.py
:load_stations.py
to find all stations where the "City" field has the value "When sending RediSearch commands to Redis, use the redisearch library to make your search queries (see examples here https://github.com/simonprickett/introducing-redis-talk/tree/main/full_text_search_and_secondary_indexing)
Test your route by calling
GET localhost:8080/api/search/bycity/Oakland
andGET localhost:8080/api/search/bycity/San Francisco
Make sure that the existing front end maps search functionality still works :)
Make sure you updated
requirements.txt
with the new redisearch library dependency.This is part of our participation in Hacktoberfest 2021. Learn how to complete this issue here: https://developer.redis.com/hacktoberfest/
Need help or want to talk to us? Join us on Discord where we have a dedicated Hacktoberfest channel: https://discord.gg/ueQwKUh5Z3