Commit 6f4056b65eb850f5424acffca82dc86b85fa67f9

Authored by Andrew Kane
1 parent c0764183

Updated readme

Showing 1 changed file with 8 additions and 17 deletions   Show diff stats
README.md
... ... @@ -134,8 +134,8 @@ boost_by: {orders_count: {factor: 10}} # default factor is 1
134 134 Boost matching documents
135 135  
136 136 ```ruby
137   -boost_where: {user_id: 1} # default factor is 1000
138   -boost_where: {user_id: {value: 1, factor: 100}}
  137 +boost_where: {user_id: 1}
  138 +boost_where: {user_id: {value: 1, factor: 100}} # default factor is 1000
139 139 ```
140 140  
141 141 [Conversions](#keep-getting-better) are also a great way to boost.
... ... @@ -828,6 +828,8 @@ Reindex one record
828 828 ```ruby
829 829 product = Product.find 10
830 830 product.reindex
  831 +# or to reindex in the background
  832 +product.reindex_async
831 833 ```
832 834  
833 835 Remove old indices
... ... @@ -902,28 +904,17 @@ class Product < ActiveRecord::Base
902 904 end
903 905 ```
904 906  
905   -Make fields unsearchable but include in the source
  907 +Create index without importing
906 908  
907 909 ```ruby
908   -class Product < ActiveRecord::Base
909   - searchkick unsearchable: [:color]
910   -end
  910 +Product.reindex(import: false)
911 911 ```
912 912  
913   -Reindex asynchronously
  913 +Make fields unsearchable but include in the source
914 914  
915 915 ```ruby
916 916 class Product < ActiveRecord::Base
917   - searchkick callbacks: false
918   -
919   - def reindex_async
920   - # custom code to reindex
921   - end
922   -
923   - after_commit :reindex_async
924   - # or for Mongoid
925   - # after_save :reindex_async
926   - # after_destroy :reindex_async
  917 + searchkick unsearchable: [:color]
927 918 end
928 919 ```
929 920  
... ...