ruby_small_white Created with Sketch.

Getting Started

Install

Install AlgoliaSearch using:

gem install algoliasearch

Ruby on Rails

If you’re a Ruby on Rails user, you’re probably looking for the algoliasearch-rails gem.

Miscellaneous

If you are a Ruby on Rails user, you are probably looking for the algoliasearch-rails gem.

Init Index

To begin, you will need to initialize the client. In order to do this you will need your Application ID and API Key. You can find both on your Algolia account.

require 'rubygems'
require 'algoliasearch'

Algolia.init application_id: 'YourApplicationID',
             api_key:        'YourAPIKey'

The api key that is displayed here is your ADMIN API Key. To maintain security, never use your ADMIN API Key on your frontend or share it with anyone. In your frontend, use the SEARCH ONLY API Key or any other key that has search only rights.