How to reindex archived as well as non archived data using searchkick

1k Views Asked by At

I have a Meeting model which contains archived as well as non archived data.

When I am running Model.reindex only non archived data is getting indexed.

I want to index non archived data as well so that I can see non archived data as well when using search method of searchkick.

For archiving I have used paranoia gem and archived column name is cancelled_at.

1

There are 1 best solutions below

2
On BEST ANSWER
Model.with_deleted.reindex

Since paranoia gem default_scope is always without the deleted/archived ones just have to use the helper scope that is documented in the paranoia readme https://github.com/rubysherpas/paranoia#usage