solidus_searchkick 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8dde9afab1926dc0020b1be0f2da90e1cf8b9b0f
4
- data.tar.gz: a9f8973fe592d1c42e88e1c74307b21e9a8cf780
3
+ metadata.gz: a48395a245488a882a67f7bee409c2eaeff6b855
4
+ data.tar.gz: 4ac9f30e6eae2780a141fc18b728986aaaed5866
5
5
  SHA512:
6
- metadata.gz: baa94632a4d4afee378e4725730590eeb5d492065f426703e3e99aa3de5735913342a921f3969dcb7ac9645f657ef0b78e48009d08a96f90236325d21a0dc81f
7
- data.tar.gz: 1c12aa84ed1687d4a915b0d38163e65744ba9bdad0933f2b63ce3cba00bf045be9798c7f48ae9f1b2525ee56ed4064c61b65228fe2571a8840b6416d72a483d6
6
+ metadata.gz: 0189386d284fe34353291c98a18ae786ad429967ee258a0a0f73044b1f03d68dbcf61f8c74b51af33e18e6c957c93a01c42bec573cd7e2e5fff85d956cdbff2c
7
+ data.tar.gz: 05d1f38bac4599b7f12588d68545cef348fb92e8c1c9ca806e71f042df9ea014f3d583bbd3d5dcaab751945194ed3582cddb5038d763929b6e94fa428df2f4e1
data/README.md CHANGED
@@ -41,20 +41,30 @@ Searchkick Integration
41
41
 
42
42
  By default, Searchkick is initialized on the Product model in SolidusSearchkick's `product_decorator` with:
43
43
  ```
44
- searchkick word_start: [:name]
44
+ searchkick index_name: ..., word_start: [:name]
45
45
  ```
46
46
 
47
47
  If you need to modify this, you can do so in your own `product_decorator`, by adding something like:
48
48
  ```
49
49
  # app/models/spree/product_decorator.rb
50
50
  Spree::Product.class_eval do
51
- searchkick word_start: [:name], callbacks: :async unless Spree::Product.try(:searchkick_options)
51
+ searchkick index_name: ..., word_start: [:name], callbacks: :async unless Spree::Product.try(:searchkick_options)
52
52
  ...
53
53
  end
54
54
  ```
55
55
  In this example, the `unless Spree::product.try(:searchkick_options)` conditional is needed, since, by default, the development environment does not cache classes and will reload them.
56
56
  Adding this condition prevents Rails from throwing an error when reloading the product decorator and trying to add searchkick multiple times.
57
57
 
58
+ #### Index Name
59
+ In version 0.3.1, the index_name option was added. It defaults to
60
+ ```
61
+ "#{Rails.application.class.parent_name.parameterize.underscore}_spree_products_#{Rails.env}"
62
+ ```
63
+
64
+ If you need are upgrading from a version of SolidusSearchkick prior to version 0.3.1, you will need to either:
65
+ - reindex all of your products (which will build the index with the new name)
66
+ - update your product_decorator to use the index_name currently being used
67
+
58
68
 
59
69
  Search Parameters
60
70
  -----------------
@@ -3,7 +3,7 @@ Spree::Product.class_eval do
3
3
  Rails.application.config.after_initialize do
4
4
  # Check if searchkick_options have been set by the application using this gem
5
5
  # If they have, then do not initialize searchkick on the model. If they have not, then set the defaults
6
- searchkick word_start: [:name] unless Spree::Product.try(:searchkick_options)
6
+ searchkick index_name: "#{Rails.application.class.parent_name.parameterize.underscore}_spree_products_#{Rails.env}", word_start: [:name] unless Spree::Product.try(:searchkick_options)
7
7
  end
8
8
 
9
9
  def search_data
data/changelog.md ADDED
@@ -0,0 +1,4 @@
1
+ # 0.3.1
2
+ Versioin 0.3.1 introduced a breaking change related to the index_name. If using a previous version of solidus_searchkick, you will need to either:
3
+ - reindex all of your products (which will build the index with the new name)
4
+ - update your product_decorator to use the index_name currently being used
@@ -1,3 +1,3 @@
1
1
  module SolidusSearchkick
2
- VERSION = '0.3.1'
2
+ VERSION = '0.3.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: solidus_searchkick
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Smith
@@ -244,6 +244,7 @@ files:
244
244
  - app/models/spree/product_decorator.rb
245
245
  - app/views/spree/shared/_filters.html.erb
246
246
  - bin/rails
247
+ - changelog.md
247
248
  - config/locales/en.yml
248
249
  - config/routes.rb
249
250
  - lib/generators/solidus_searchkick/install/install_generator.rb