From a8592a9b27bc33d407328a0b56db4a35d65b9b80 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 20 Jan 2014 20:24:19 -0800 Subject: [PATCH] Added asynchronous reindexing to readme --- README.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 5edf3b1..1ef6647 100644 --- a/README.md +++ b/README.md @@ -655,6 +655,23 @@ class Product < ActiveRecord::Base end ``` +Asynchronous reindexing + +```ruby +class Product < ActiveRecord::Base + searchkick callbacks: false + + # add the callbacks manually + after_save :reindex_async + after_destroy :reindex_async + + def reindex_async + # delayed job + delay.reindex + end +end +``` + Reindex all models (Rails only) ```sh -- libgit2 0.21.0