Skip to content

Instantly share code, notes, and snippets.

View edariedl's full-sized avatar

Eda Riedl edariedl

View GitHub Profile
@edariedl
edariedl / gist:a1c35eb68aebdf41876c
Last active May 7, 2024 08:30
Bulk delete of documents from Elasticsearch in Ruby on Rails

Bulk delete of documents from Elasticsearch in Ruby on Rails

When someone deletes his account we need to delete data from the elasticsearch. All account data are removed by bulk SQL query but elasticsearch-model cannot be notified to destroy related elasticsearch documents. I had to find out how to do it. It had to be done in the background job otherwise it could take too long.

After looking around in the source code of elasticsearch ruby gems, Elastcisearch API and with a little help from Karmi (author of elasticsearch gems) I found a solution. It consists of the following three things.

@edariedl
edariedl / cs-jq-plugin-template.coffee
Created June 7, 2017 12:30 — forked from rjz/cs-jq-plugin-template.coffee
Coffeescript jQuery Plugin Class Template
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->