algoliasearch-rails icon indicating copy to clipboard operation
algoliasearch-rails copied to clipboard

Hash with indifferent access for hits

Open RealSilo opened this issue 3 years ago • 0 comments

  • Rails version: gem 'rails', '~> 6.1.3.1'
  • Algolia Rails integration version: gem 'algoliasearch-rails', '~> 2.1', '>= 2.1.1'
  • Algolia Client Version: #.#.#
  • Language Version: ruby '2.7.1'

Description

In the def algolia_search function:

json = algolia_raw_search(q, params) hit_ids = json['hits'].map { |hit| hit['objectID'] }

This throws an error as the hash uses symbol keys in the new version but the access uses string keys.

Steps To Reproduce

Just upgraded to 2.1.1. Simply use search (not raw)

RealSilo avatar Aug 06 '21 23:08 RealSilo