From 6331e5ea6ae48fee18b8cc7914c2582c00ad392d Mon Sep 17 00:00:00 2001 From: Daniel Ferraz Date: Thu, 18 Dec 2014 17:19:57 -0200 Subject: [PATCH] Update README.md --- README.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 30e4b6f..2ff8625 100644 --- a/README.md +++ b/README.md @@ -832,6 +832,25 @@ product.reindex product.reindex_async ``` +Reindex more than one record without recreating the index + +```ruby +# do this ... +some_company.products.each { |p| p.reindex } +# or this ... +Product.searchkick_index.import(some_company.products) +# don't do the following as it will recreate the index with some_company's products only +some_company.products.reindex +``` + +Reindex large set of records in batches + +```ruby +Product.where("id > 100000").find_in_batches do |batch| + Product.searchkick_index.import(batch) +end +``` + Remove old indices ```ruby -- libgit2 0.21.0