Simple project that uses redis plugins such as redisjson and redisearch to implement my library app
To use insert json into Redis run npm run insert books.json
.
- Simple search on text attributes of
idx:books
index
FT.SEARCH idx:books Kaz
- Simple sorting using search
FT.SEARCH idx:books * SORTBY rating DESC RETURN 2 name rating
- Aggregate query with multiple steps
FT.AGGREGATE idx:books * GROUPBY 1 @author REDUCE COUNT 0 AS no_of_books SORTBY 2 @no_of_books DESC LIMIT 0 5
Redis package Command to run rest API
npm run start
Query | Endpoint |
---|---|
Search | localhost:8000?search=Kaz |
Sort | localhost:8000/top |
Aggregation | localhost:8000/most-read |