solidus_searchkick 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +12 -2
- data/app/models/spree/product_decorator.rb +1 -1
- data/changelog.md +4 -0
- data/lib/solidus_searchkick/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a48395a245488a882a67f7bee409c2eaeff6b855
|
4
|
+
data.tar.gz: 4ac9f30e6eae2780a141fc18b728986aaaed5866
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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
|