algolia / algoliasearch-rails

AlgoliaSearch integration to your favorite ORM
MIT License
410 stars 118 forks source link

Outdated documentation for deleting record #399

Closed cabello closed 2 years ago

cabello commented 3 years ago

Description

I recently integrated with Algolia again, my past experiences have been excellent, this time however due to outdated documentation I stepped in a few landmines.

The Sidekiq section suggests using Algolia::Index https://github.com/algolia/algoliasearch-rails/tree/64b4f9ed338d9f9cc1ab873251a08561c6e03623#things-to-consider Due to recent changes in the API from the underlying client gem, the code snippet no longer works: https://github.com/algolia/algoliasearch-client-ruby/blob/5e7c715a596ac5e01064a16e9f46d3aaa825850b/upgrade_guide.md

Replacing it by Algolia::Search::Index is not enough as that class requires 3 params to be initialized.

I eventually set on using index = AlgoliaSearch.client.init_index(index_name)

Search tags to helps others find this:

NameError (uninitialized constant Algolia::Index) ArgumentError (wrong number of arguments (given 1, expected 3)) (when doing Algolia::Search::Index.new)

donalod commented 2 years ago

Thanks for this @cabello confirming it works and indeed needs updating (lost time to this today which was the icing on the cake to the API outage which left me scratching my head as to why timeouts were not being honored in the gem)...