OpenSearch
Description
OpenSearch is the open source flavour of ElasticSearch, by AWS. Treatwell uses it to enable full text search, in-model as well as cross-model.
Local Setup
docker-compose
This repository comes with docker-compose configuration files to ease the setup and run OpenSearch.
You can run:
docker compose -f docker-compose.yml up opensearch-node1 opensearch-node2 opensearch-dashboards
Known issues
Specs fail with a run SomeModel.reindex error
When you run bundle exec rspec, specs may fail with an error similar to the following:
Searchkick::InvalidQueryError:
Bad mapping - run VenueProduct.reindex
It happens because the spec suite is configured to create OpenSearch index only if OPENSEARCH_URL is present.
Such env var is defined in .env.test, but if you created a .env.test.local you'll have to define it there too, copying it from .env.test:
echo 'OPENSEARCH_URL=https://localhost:9200' >> .env.test.local