Commit efa40594786f1199b6869b534b57ab2be4b38d7f

Authored by Andrew Kane
1 parent 3344b243

Started sections on large data sets and testing - #95

Showing 1 changed file with 28 additions and 0 deletions   Show diff stats
README.md
... ... @@ -974,6 +974,34 @@ Reindex all models - Rails only
974 974 rake searchkick:reindex:all
975 975 ```
976 976  
  977 +## Large Data Sets
  978 +
  979 +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.
  980 +
  981 +## Testing
  982 +
  983 +This section could use some love.
  984 +
  985 +### RSpec
  986 +
  987 +```ruby
  988 +describe Product do
  989 + it "searches" do
  990 + Product.reindex
  991 + Product.searchkick_index.refresh # don't forget this
  992 + # test goes here...
  993 + end
  994 +end
  995 +```
  996 +
  997 +### Factory Girl
  998 +
  999 +```ruby
  1000 +product = FactoryGirl.create(:product)
  1001 +product.reindex # don't forget this
  1002 +Product.searchkick_index.refresh # or this
  1003 +```
  1004 +
977 1005 ## Migrating from Tire
978 1006  
979 1007 1. Change `search` methods to `tire.search` and add index name in existing search calls
... ...