Search API Client for Ruby
Algolia Ruby Gem

API-first search and discovery for your Ruby applications.

Utilize the Algolia open-source Ruby gem to index your data, configure your search, add analytics and much more.  

Algolia is an API-First Search and Discovery platform that empowers builders to compose experiences at scale. Explore Algolia

Features

  • Gives API access to all Algolia functionality, settings, advanced features, and ML/AI products
  • Installs with and without Bundler
  • Compatible with ActiveRecord, Mongoid, and Sequel
  • Built with modern tools: Minitest, Yard convention, Faraday
  • Background retry strategy to ensure uptime
  • Seamless batching via iterators to optimize number of network calls
  • Zero downtime reindexing feature
  • Thin & minimal low-level HTTP client to interact with Algolia's API

Version

  • Supports Ruby version 2.2+

Related Integrations

Key links


Get started

Install (get a free account here.)

1gem install algolia

Index

1res = index.save_objects([{
2  firstname: 'Jimmie',
3  lastname:  'Barninger',
4  objectID:  'myID1'
5}, {
6  firstname: 'Warren',
7  lastname:  'Speach',
8  objectID:  'myID2'
9}])

Search

1index = client.init_index('contacts')
2
3// Search without settings
4res = index.search('query string')
5
6// Search with settings
7res = index.search('query string', {
8  params: {
9    attributesToRetrieve: 'firstname,lastname',
10    hitsPerPage: 20
11  }
12})
Get started for freeExplore all developer docs

Built with Algolia

Showcase
Demo

Yarn

Search all packages in the npm and yarn registry

  • typescript
  • javascript
  • ruby