Commit 4dff9514795979ae26bb6db20de35179f40d9e23

Authored by Andrew Kane
1 parent dca8d4c2

Added examples with mode - #1554 [skip ci]

Showing 1 changed file with 14 additions and 0 deletions   Show diff stats
README.md
... ... @@ -592,6 +592,14 @@ There are four strategies for keeping the index synced with your database.
592 592 end
593 593 ```
594 594  
  595 + And reindex a record or relation manually.
  596 +
  597 + ```ruby
  598 + product.reindex
  599 + # or
  600 + store.products.reindex(mode: :async)
  601 + ```
  602 +
595 603 You can also do bulk updates.
596 604  
597 605 ```ruby
... ... @@ -608,6 +616,12 @@ Searchkick.callbacks(false) do
608 616 end
609 617 ```
610 618  
  619 +Or override the model’s strategy.
  620 +
  621 +```ruby
  622 +product.reindex(mode: :async) # :inline or :queue
  623 +```
  624 +
611 625 ### Associations
612 626  
613 627 Data is **not** automatically synced when an association is updated. If this is desired, add a callback to reindex:
... ...