-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add batch operations #27
Conversation
lib/nazrin/searchable.rb
Outdated
hash[:add] = objects.map do |obj| | ||
[obj.send(:id), nazrin_eval_field_data(obj)] | ||
end | ||
else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like you to specify delete
for typo
lib/nazrin/searchable.rb
Outdated
@@ -81,6 +81,22 @@ def nazrin_add_document(obj) | |||
obj.send(:id), nazrin_eval_field_data(obj)) | |||
end | |||
|
|||
def nazrin_batch_operation(type_objects_mapping) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for review @tsuwatch, I also added |
Let me know if you want me to squash commits |
Why need |
I just thought I may as well add them as aliases as they're familiar methods for people using Rails, I can remove if you like? |
lib/nazrin/document_client.rb
Outdated
) | ||
end | ||
when :delete, :destroy | ||
tuple.map do |id| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna change this to each
rather than map
as map
implies that the return value matters.
Hmm, I think It is not necessary to support the aliases. |
@tsuwatch removed |
Nice work, thank you!!! |
Thanks @tsuwatch 😄 |
Example: