From efa40594786f1199b6869b534b57ab2be4b38d7f Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Sat, 28 Feb 2015 15:11:38 -0800 Subject: [PATCH] Started sections on large data sets and testing - #95 --- README.md | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+), 0 deletions(-) diff --git a/README.md b/README.md index 6cb32fa..cb22775 100644 --- a/README.md +++ b/README.md @@ -974,6 +974,34 @@ Reindex all models - Rails only rake searchkick:reindex:all ``` +## Large Data Sets + +For large data sets, check out [Keeping Elasticsearch in Sync](https://www.found.no/foundation/keeping-elasticsearch-in-sync/). Searchkick will make this easy in the future. + +## Testing + +This section could use some love. + +### RSpec + +```ruby +describe Product do + it "searches" do + Product.reindex + Product.searchkick_index.refresh # don't forget this + # test goes here... + end +end +``` + +### Factory Girl + +```ruby +product = FactoryGirl.create(:product) +product.reindex # don't forget this +Product.searchkick_index.refresh # or this +``` + ## Migrating from Tire 1. Change `search` methods to `tire.search` and add index name in existing search calls -- libgit2 0.21.0