Rails 7 Elasticsearch Searchkick::Error - Multiple clients found

70 Views Asked by At

Getting this error when using Searchkick with elasticsearch in Rails 7.

Searchkick::Error - Multiple clients found - set Searchkick.client_type = :elasticsearch or :opensearch:

Here are the Gems I have added:

gem "searchkick"
gem "elasticsearch"   
gem "opensearch-ruby" 

And I did bundle install the installation completed without any issue.

Here is my model:

class Order < ApplicationRecord
  searchkick
end

Here is my controller's search function:

results = Order.search("W-1910300")
logger.info(results.total_count.inspect)

Screenshot of the terminal log: enter image description here

0

There are 0 best solutions below