Connection errors
Are you getting “Impossible to connect”, “Unable to connect”, or “Unreachable hosts” errors? First, make sure the issue isn’t at your end:- Ensure you’re using the correct application ID and API key. Find these credentials on your Algolia dashboard.
- Check for recent changes in your code.
- Check the status of your data center provider.
If you’re using Firebase, you can only access Algolia from a paid Firebase tier.
- The name of the used gem and its version number
- A code snippet to reproduce the issue
- Error message or stack trace (if applicable)
- The name of the Algolia index that’s causing problems
- The exact UTC time of the event
- If you can’t connect to the Algolia API from your browser, send the output from community.algolia.com/diag/.
-
If you can’t connect to the Algolia API from your servers, send the output from the following command (run on any affected server):
Replace
ALGOLIA_APPLICATION_ID
with your Algolia application ID.
Raise or log exceptions
By default, this gem raises exceptions if something goes wrong.Turn off indexing
Use the following code snippet to turn off indexing based on the current Rails environment. This can be helpful during testing or development.Ruby
Wait for indexing tasks
Indexing operations are asynchronous by default. During your tests, you might create models and then confirm if they were indexed in Algolia. To test this, it’s best to make your indexing synchronous.Ruby
Only use this option for testing.
Run tests for the Algolia Search gem
If you want to contribute to this gem, you can run the tests locally or let the CI run them when opening your pull requests. Before you run the tests, set theALGOLIA_APPLICATION_ID
and ALGOLIA_API_KEY
environment variables.
Since the tests create and delete indices, make sure the index names won’t affect your production.