Please note: since January 2022, this demo is now hosted at https://github.com/meilisearch/demos/tree/main/src/finding-rubygems
A new experience of search to find your favorite RubyGems 🎉
Search by gem name or by keywords.
The search is powered by MeiliSearch, the open-source and instant search engine.
- MeiliSearch finds PyPI packages (Python)
- MeiliSearch finds Crates (Rust)
This project uses the Ruby SDK for MeiliSearch.
Set the following environment variables:
MEILISEARCH_HOST_URL
MEILISEARCH_API_KEY
Run:
$ bundle install
$ bundle exec ruby meilisearch/app.rb
require 'meilisearch'
...
settings = {
rankingRules: [
'typo',
'words',
'desc(fame)',
'proximity',
'attribute',
'exactness',
'desc(total_downloads)',
],
searchableAttributes: [
'name',
'summary'
],
displayedAttributes: [
'name',
'summary',
'description',
'version',
'total_downloads'
]
}
client = MeiliSearch::Client.new(URL, API_KEY)
client.index(index_uid).update_settings(settings)
The front is deployed to GitHub Pages.
All gems data and main of HTML/CSS come from RubyGems website.
The script to fetch data and push them to MeiliSearch runs every day on Heroku with to Heroku Scheduler.
Here is the repository of MeiliSearch.