Search API Client for Ruby

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

  • Ruby on Rails, Shopify
  • InstantSearch for React, Vue, Angular, vanilla 
  • Autocomplete

Key links


Get started

INSTALL

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})

Built with Algolia