Hi! This is an example Rails 7 app using OpenSearch with Stimulus and Turbo for a very basic book search.
First, make sure you have homebrew downloaded:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
To get setup, run these scripts:
bin/setup
bin/setup-database
We are currently using Ruby 3.1.2
Our setup script uses rbenv
to manage our ruby version. We install rbenv (and other dependencies) using Homebrew.
The ruby version is locked in the .ruby-version
, which rbenv consumes.
If you haven't already, run bin/setup-database
. Otherwise, you can do it manually using the rake tasks, such as:
run rake db:setup
Provision an OpenSearch cluster, grab your URL, and put it in your env:
BONSAI_URL=https://username:password@opensearch-example-r-1234567890.us-west-1.bonsaisearch.net:443
You can do this two ways:
- Provision a hobby cluster on bonsai.io
- Download OpenSearch and serve it locally
If the second, there are a few options:
- Download directly from opensearch.org - they have
- Install with Hombrew:
brew install opensearch
When this is done, index your models with: