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
[MODEL] Added the ability to transform models during indexing
For instance, to add the `_parent` field to indexed documents:
transform = lambda do |a|
{ index: {_id: a.id, _parent: a.author_id, data: a.__elasticsearch__.as_indexed_json} }
end
Article.import transform: transform
Closeselastic#113
Copy file name to clipboardExpand all lines: elasticsearch-model/lib/elasticsearch/model/importing.rb
+20-4
Original file line number
Diff line number
Diff line change
@@ -68,11 +68,24 @@ module ClassMethods
68
68
#
69
69
# Article.import scope: 'published'
70
70
#
71
+
# @example Customize how each record is [bulk imported](https://github.com/elasticsearch/elasticsearch-ruby/blob/master/elasticsearch-api/lib/elasticsearch/api/actions/bulk.rb)
0 commit comments