Framework integration / Rails / Advanced

Using the API client

You would typically need to use the Algolia client to perform API keys operations. The client is available as a singleton and will use the algolia credentials set in the Rails configuration.

key = AlgoliaSearch.client.add_api_key({ acl: ['search'], 'indexes': ['*_development', '*_development.tmp'] })

Using the model underlying the index

If you want to access the index used by a model, you can call the index class method. This method follows your naming configuration (per environment settings or custom names, for instance).

index = Contact.index
# index.get_settings, index.partial_update_object, ...
Did you find this page helpful?