From 4dc3b8e8ca95a856a91734983ba3d702dd85aff7 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Wed, 17 Jul 2013 21:49:48 -0700 Subject: [PATCH] Added migrating from tire guide --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 0ac006c..a900325 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,34 @@ Partial matches (needs better name) Item.search "fresh honey", partial: true # matches organic honey ``` +### Migrating from Tire + +1. Change `search` methods to `tire.search` and add index name in existing search calls + + ```ruby + Product.search "fruit" + ``` + + should be replaced with + + ```ruby + Product.tire.search "fruit", index: "products" + ``` + +2. Replace tire mapping w/ searchkick method + + ```ruby + searchkick index_name: "products_v2" + ``` + +3. Deploy and reindex + + ```ruby + rake searchkick:reindex CLASS=Product # or Product.reindex in the console + ``` + +4. Once it finishes, replace search calls w/ searchkick calls + ## Elasticsearch Gotchas ### Inconsistent Scores -- libgit2 0.21.0