From aa4ba9e7ec4630c371ebddaf5e5d92d41c832c04 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 22 Jul 2013 23:57:45 -0700 Subject: [PATCH] Added reindex instance method --- README.md | 2 +- lib/searchkick/model.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index af34410..2d01f8d 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ Reindex one item ```ruby product = Product.find(1) -product.update_index +product.reindex ``` Partial matches (needs better name) diff --git a/lib/searchkick/model.rb b/lib/searchkick/model.rb index 9dbbdae..da8ae02 100644 --- a/lib/searchkick/model.rb +++ b/lib/searchkick/model.rb @@ -9,6 +9,10 @@ module Searchkick include Tire::Model::Search include Tire::Model::Callbacks + def reindex + update_index + end + def to_indexed_json respond_to?(:search_data) ? search_data.to_json : super end -- libgit2 0.21.0