spree_meilisearch 6.0.0.rc5 → 6.0.0.rc6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8f94477fde31d06c36e7a1f175a1e43f52489d85f9f4839ae833cfa54c28538d
4
- data.tar.gz: a09ac8be2f84ae065991e2b732f632947041de9f1849ca0a403a92a03475a6e3
3
+ metadata.gz: 0b4c94b2570967e89a7210806d69c23d03e2612b5c30b491383a1b1430f06635
4
+ data.tar.gz: 0b2cb90b39b5736f53552fe0c6ecc9cb6f3ef3caaf52922a1d1268ca1e71ecc4
5
5
  SHA512:
6
- metadata.gz: 04afd4d67734b1ee501891556fb9f2de495be857109281b201996cad2b516eaeb4e0144231b15ff7f60b0ab6498cd4705b814c36a37d6e75314fc559682d7c05
7
- data.tar.gz: b8402507b2041a0ff03008a835eeaab4dc30cac299cca4b487d2427844c3c95dc528cc487076c4cdf83d19a3fb08c703ec1389c1f69aca8107670980b0dced9c
6
+ metadata.gz: 96f8faf32b2bef561ac0831de2ae8ca18e10565a7d54652ad2ab3619fb88e02d07fd9ef96ef6957b0de63a9dd2147d89848f3c961b850fd051c8881f878d86e9
7
+ data.tar.gz: 919ddf17dcfe68d72107778541828ab0b212a90420bcb9feb0c4fc7fe0740e270c85ec429b3b6c033489ff7e13145be80d055dcfafa4989cb0dcf3f4e4369342
@@ -101,7 +101,7 @@ module SpreeMeilisearch
101
101
  def reindex(scope = nil)
102
102
  full_reindex = scope.nil?
103
103
  scope ||= store.products
104
- @custom_field_schema = Spree::SearchProvider::CustomFieldSchema.new(store)
104
+ @custom_field_schema = storefront_custom_field_schema
105
105
  ensure_index_settings!
106
106
 
107
107
  # On a full reindex, clear first so stale docs (e.g. membership docs for
@@ -285,6 +285,18 @@ module SpreeMeilisearch
285
285
  "#{store.code}_products"
286
286
  end
287
287
 
288
+ # The index is the storefront's: shoppers search it and the back office
289
+ # never does, so its vocabulary is the storefront schema whatever audience
290
+ # this provider was built for. A back-office reindex must not teach the
291
+ # shared index about admin-only fields.
292
+ def custom_field_schema
293
+ @custom_field_schema ||= storefront_custom_field_schema
294
+ end
295
+
296
+ def storefront_custom_field_schema
297
+ Spree::SearchProvider::CustomFieldSchema.new(store, audience: :store)
298
+ end
299
+
288
300
  def searchable_attributes
289
301
  %w[name description sku option_values category_names tags] + custom_field_schema.searchable_attribute_keys
290
302
  end
@@ -93,10 +93,12 @@ module SpreeMeilisearch
93
93
  end
94
94
 
95
95
  # Flat cf_* hash for searchable ∪ sortable custom_fields (Meilisearch docs).
96
+ # Storefront-visible ones only: the index is the storefront's, and a value
97
+ # the serializer withholds has no business in a document it can search.
96
98
  def custom_field_document_attributes
97
99
  @custom_field_document_attributes ||= product.custom_fields.filter_map do |custom_field|
98
100
  definition = custom_field.custom_field_definition
99
- next unless definition&.searchable? || definition&.sortable?
101
+ next unless definition&.storefront_visible? && (definition.searchable? || definition.sortable?)
100
102
 
101
103
  [definition.filter_key, custom_field_index_value(custom_field, definition.field_type)]
102
104
  end.to_h
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree_meilisearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.0.0.rc5
4
+ version: 6.0.0.rc6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vendo Connect Inc.
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2026-10-22 00:00:00.000000000 Z
12
+ date: 2026-10-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: meilisearch
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - '='
33
33
  - !ruby/object:Gem::Version
34
- version: 6.0.0.rc5
34
+ version: 6.0.0.rc6
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - '='
40
40
  - !ruby/object:Gem::Version
41
- version: 6.0.0.rc5
41
+ version: 6.0.0.rc6
42
42
  description: Instant product search, filtering and faceted navigation for Spree via
43
43
  Meilisearch
44
44
  email: hello@spreecommerce.org
@@ -58,9 +58,9 @@ licenses:
58
58
  - MIT
59
59
  metadata:
60
60
  bug_tracker_uri: https://github.com/spree/spree/issues
61
- changelog_uri: https://github.com/spree/spree/releases/tag/v6.0.0.rc5
61
+ changelog_uri: https://github.com/spree/spree/releases/tag/v6.0.0.rc6
62
62
  documentation_uri: https://docs.spreecommerce.org/
63
- source_code_uri: https://github.com/spree/spree/tree/v6.0.0.rc5
63
+ source_code_uri: https://github.com/spree/spree/tree/v6.0.0.rc6
64
64
  post_install_message:
65
65
  rdoc_options: []
66
66
  require_paths: