Method: Elastictastic::BulkPersistenceStrategy#destroy
- Defined in:
- lib/elastictastic/bulk_persistence_strategy.rb
#destroy(instance, &block) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 |
# File 'lib/elastictastic/bulk_persistence_strategy.rb', line 56 def destroy(instance, &block) block ||= DEFAULT_HANDLER instance.pending_destroy! add(instance.index, instance.id, :delete => bulk_identifier_for_instance(instance)) do |response| if response['delete']['error'] block.call(ServerError[response['delete']['error']]) else instance.transient! instance.version = response['delete']['_version'] block.call end end end |