From 4dff9514795979ae26bb6db20de35179f40d9e23 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 18 May 2022 14:48:57 -0700 Subject: [PATCH] Added examples with mode - #1554 [skip ci] --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index a4854f1..5929fb1 100644 --- a/README.md +++ b/README.md @@ -592,6 +592,14 @@ There are four strategies for keeping the index synced with your database. end ``` + And reindex a record or relation manually. + + ```ruby + product.reindex + # or + store.products.reindex(mode: :async) + ``` + You can also do bulk updates. ```ruby @@ -608,6 +616,12 @@ Searchkick.callbacks(false) do end ``` +Or override the model’s strategy. + +```ruby +product.reindex(mode: :async) # :inline or :queue +``` + ### Associations Data is **not** automatically synced when an association is updated. If this is desired, add a callback to reindex: -- libgit2 0.21.0