https://github.com/nimblehq/redisearch-ruby-demo
Small demo application, illustrating how to use RediSearch with ruby in a dockerized environment
https://github.com/nimblehq/redisearch-ruby-demo
redis redisearch ruby
Last synced: 16 days ago
JSON representation
Small demo application, illustrating how to use RediSearch with ruby in a dockerized environment
- Host: GitHub
- URL: https://github.com/nimblehq/redisearch-ruby-demo
- Owner: nimblehq
- Created: 2020-11-26T07:52:30.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-23T08:19:47.000Z (over 5 years ago)
- Last Synced: 2025-09-01T12:46:53.789Z (9 months ago)
- Topics: redis, redisearch, ruby
- Language: Ruby
- Homepage:
- Size: 7.81 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# redisearch-ruby-demo
## About
This repo provides a small demo for using RediSearch with ruby
## Dependences
docker, docker-compose
## Installation
Run the following commands to install using docker
```
docker-compose build
docker-compose up
```
Then notice the console output carefully, as the startup script for docker container adds some seed data into redis, and performs
some search operations as well. Have a look at files below to understand how the scripts work:
```
start.sh
/scripts/create_schema.rb
/scripts/add_product.rb
/scripts/search_product.rb
```
## Usage
```
docker ps # Get the container id of the app
docker exec -it {container_id} /bin/bash
```
* To search for a product from seed data
```
ruby scripts/search_product.rb Jui
ruby scripts/search_product.rb Man
```
* To add a new product
```
ruby scripts/add_product.rb #{id} #{name} #{quantity}
ruby scripts/add_product.rb 1 Apple 5
```