Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Use in_batches.each with pluck in the AR case, so that we avoid loading all of the objects into memory when we're really just looking for ids here.
Mongoid supports pluck as of 3.0.1. I'm not sure what version searchkick targets, but it looks like latest Mongoid is 5.0+, so maybe worth dropping support for lower than 3.0.1?
This is a PR after a cursory read of the code and reading #1549, so please challenge any assumptions I've made.
I couldn't get tests running locally, it was unclear in the README#contributing section, so I may just not have ES running locally.