Mayuresh Srivastava
Mayuresh Srivastava

Reputation: 1422

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

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.

Upvotes: 0

Views: 1154

Answers (1)

Denny Mueller
Denny Mueller

Reputation: 3615

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

Upvotes: 2

Related Questions