Commit 4dc3b8e8ca95a856a91734983ba3d702dd85aff7
1 parent
67cd302e
Exists in
master
and in
21 other branches
Added migrating from tire guide
Showing
1 changed file
with
28 additions
and
0 deletions
Show diff stats
README.md
@@ -165,6 +165,34 @@ Partial matches (needs better name) | @@ -165,6 +165,34 @@ Partial matches (needs better name) | ||
165 | Item.search "fresh honey", partial: true # matches organic honey | 165 | Item.search "fresh honey", partial: true # matches organic honey |
166 | ``` | 166 | ``` |
167 | 167 | ||
168 | +### Migrating from Tire | ||
169 | + | ||
170 | +1. Change `search` methods to `tire.search` and add index name in existing search calls | ||
171 | + | ||
172 | + ```ruby | ||
173 | + Product.search "fruit" | ||
174 | + ``` | ||
175 | + | ||
176 | + should be replaced with | ||
177 | + | ||
178 | + ```ruby | ||
179 | + Product.tire.search "fruit", index: "products" | ||
180 | + ``` | ||
181 | + | ||
182 | +2. Replace tire mapping w/ searchkick method | ||
183 | + | ||
184 | + ```ruby | ||
185 | + searchkick index_name: "products_v2" | ||
186 | + ``` | ||
187 | + | ||
188 | +3. Deploy and reindex | ||
189 | + | ||
190 | + ```ruby | ||
191 | + rake searchkick:reindex CLASS=Product # or Product.reindex in the console | ||
192 | + ``` | ||
193 | + | ||
194 | +4. Once it finishes, replace search calls w/ searchkick calls | ||
195 | + | ||
168 | ## Elasticsearch Gotchas | 196 | ## Elasticsearch Gotchas |
169 | 197 | ||
170 | ### Inconsistent Scores | 198 | ### Inconsistent Scores |