elastic/elasticsearch-rails

ActiveRecord adapter ignores query parameters and conditions in Rails 6.1 aka Elasticsearch::Transport::Transport::Errors::RequestEntityTooLarge error

robmathews opened this issue · 0 comments

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:

objs = Article.where(id: 1)
objs.__elasticsearch__.import(refresh: true)

It will attempt to generate an index update for all articles in the database, not just the one, and this results in a Elasticsearch::Transport::Transport::Errors::RequestEntityTooLarge error.