You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
When reindexing a model, I want to trigger a reindex on some associations. Currently, I have some custom code that decides whether that association should be reindexed. If it is, I can only call association.reindex. I tried using association.reindex(async: true) but that doesn't work, the async option gets dropped when calling import_scope(relation, scope: scope) in lib/searchkick/index.rb -> def reindex
Describe the solution you'd like
Can we pass along the options to the import_scope? I tried locally and in my older version of the gem (4.1.1) it complains about refresh and mode but since the newer version of the gem already removes the refresh option, we'd just need to delete mode and we'd be good to go. I think this would be very beneficial for large associations, in order to leverage the BulkReindexer vs loading everything in batches synchronously 🤒
Happy to open a PR to handle that but wanted to check with you that I'm not missing some purposeful restriction first :)
The text was updated successfully, but these errors were encountered:
Hey @gbxl, thanks for the suggestion. This is part of the plan for Searchkick 5 (#1288). I'm planning to make significant changes to the reindexing logic, so want to hold off until then.
Is your feature request related to a problem? Please describe.
When reindexing a model, I want to trigger a reindex on some associations. Currently, I have some custom code that decides whether that association should be reindexed. If it is, I can only call
association.reindex
. I tried usingassociation.reindex(async: true)
but that doesn't work, theasync
option gets dropped when callingimport_scope(relation, scope: scope)
inlib/searchkick/index.rb -> def reindex
Describe the solution you'd like
Can we pass along the options to the
import_scope
? I tried locally and in my older version of the gem (4.1.1) it complains aboutrefresh
andmode
but since the newer version of the gem already removes therefresh
option, we'd just need to deletemode
and we'd be good to go. I think this would be very beneficial for large associations, in order to leverage theBulkReindexer
vs loading everything in batches synchronously 🤒Happy to open a PR to handle that but wanted to check with you that I'm not missing some purposeful restriction first :)
The text was updated successfully, but these errors were encountered: