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
which seems to be because rails has natively imported the bulk import feature.
I tried working around this by calling
objs.__elasticsearch__.import(refresh: true)
but instead that cause ActiveRecords import method to still be called, and that calls some serialization code, which ends badly with a "document too large' error, like this:
Actually, the problem is more that the ActiveRelation integration is broken, so that instead of updating only the specified records, it is attempting to update all records, ignoring the conditions on the relation.
ie, if you do something like:
Article.where(id: 1).in_batches(of: 50) do |objs|
objs.__elasticsearch__.import(refresh: true)
end
It will fetch all Article, not the specified one as the import.
I tried this without in_batches(of: 50) and got the same result. ie, this simplifies down to:
Hi there! Migrating some code from rails 5.2 to rails 6.1.4 and this code is failing:
with a traceback like this:
which seems to be because rails has natively imported the bulk import feature.
I tried working around this by calling
but instead that cause ActiveRecords import method to still be called, and that calls some serialization code, which ends badly with a "document too large' error, like this:
so it doesn't work.
The text was updated successfully, but these errors were encountered: