Skip to content

Commit

Permalink
chore: refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosgz committed Jul 10, 2024
1 parent 101ceda commit 08186a5
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lib/esse/index/documents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,7 @@ def import(*repo_types, context: {}, eager_include_document_attributes: false, l
cluster.may_update_type!(kwargs)

doc_attrs[:eager].each do |attr_name|
result = repo.retrieve_lazy_attribute_values(attr_name, *batch.reject(&:ignore_on_index?))
next if result.empty?

result.each do |doc_header, value|
repo.retrieve_lazy_attribute_values(attr_name, *batch.reject(&:ignore_on_index?)).each do |doc_header, value|
doc = batch.find { |d| doc_header.id == d.id && doc_header.type == d.type && doc_header.routing == d.routing }
doc&.mutate(attr_name) { value }
end
Expand Down

0 comments on commit 08186a5

Please sign in to comment.