0

I would like to index differents variations of the same record, just like explained in this doc:

How should I do this with the Algoliasearch-Rails gem ? I can't find any doc or example about this.

More details:

I have a model Card which embeds_many Locations (Mongoid). For each location of this card, I would like to add a new record in my Algolia index and then Group the result by Card's slug.

GrégoireC
  • 279
  • 5
  • 15

1 Answers1

1

This is unfortunately not something you can do with the current (1.x) version of the algoliasearch-rails library: a model is bound to a single index through through a single algoliasearch block.

I would recommend going with the underlying Ruby API client and implement the logic you need in the after_save/destroy callbacks of your model.

redox
  • 2,269
  • 13
  • 22