Rails for the Ruby Search API

Ruby on Rails

Algolia API client for Ruby (works with Ruby on Rails)

Sign up

Features

  • Made to simplify the usage of Algolia’s API within the Ruby on Rails Framework

  • Compatible with ActiveRecordMongoidSequel

  • Built to manage all search, indexing, events, and Recommend functionality

  • 100% open source

  • Comes with a WebMock sample configuration to mock Algolia’s API

  • Background retry strategy to ensure uptime

  • Seamless batching via iterators to optimize number of network calls

  • Zero downtime reindexing feature

Version

  • This gem supports Ruby from 2.4.x to 3.0.0 and Rails 5.x and 6.x

Related Integrations

Ruby API Client, Autocomplete, InstantSearch

Get started

  • Install
    1
    gem install algoliasearch-rails
  • Index
    1
    class Contact < ActiveRecord::Base
    2
      include AlgoliaSearch
    3
    4
      algoliasearch do
    5
        attributes :first_name, :last_name, :email
    6
        attribute :company do
    7
          { name: company_name, website: company_website }
    8
        end
    9
      end
    10
    end
    11
    12
    Contact.reindex!
  • Search
    1
    Contact.algolia_search("jon doe")
Get started for free
Explore developer docs