Skip to content

Conversation

@tamvt
Copy link
Contributor

@tamvt tamvt commented Nov 30, 2025

This pull request introduces a new feature that allows custom fields to be marked as searchable on a per-field basis, rather than being searchable by default. This change optimizes search index size and performance, especially for stores with many custom fields. The UI has been updated to support toggling the "Include in search" option for product custom fields, and relevant backend and frontend logic, tests, and translations have been added or updated to support this functionality.

Key changes:

Custom Field Searchability Feature:

  • Custom fields are now not searchable by default; a new "Include in search" toggle has been added to the custom field detail modal for product custom fields. Enabling this option requires reindexing for existing fields. [1] [2] [3] [4]
  • UI components and snippets updated to support the new searchability toggle and display informational banners when the search status changes. [1] [2] [3] [4] [5]
  • Default value for includeInSearch is set to false for new custom fields, and the value is preserved for existing fields. [1] [2]

Search Configuration and Filtering:

  • The custom field search configuration UI and backend now filter custom fields to only show those with includeInSearch = true. [1] [2]
  • Corresponding tests added to ensure filtering by includeInSearch works as expected.

Admin UI update:

Screenshot 2025-12-24 at 17 59 40

Backend Support:

  • New event subscriber service CustomFieldSearchableSubscriber registered to handle backend logic related to searchable custom fields.

@tamvt tamvt self-assigned this Nov 30, 2025
@tamvt tamvt added component/advanced-search component/search domain/inventory Responsible for managing products and everything product-related labels Nov 30, 2025
@explore-openapi
Copy link

explore-openapi bot commented Nov 30, 2025

OpenAPI Snapshot

Project: shopware/store-api

No changes detected

Your OpenAPI schema is identical to the base branch (trunk).

Links:
All Project Snapshots · Base Branch Snapshot

Project: shopware/admin-api

Changes detected: 2 total
0 additions · 0 removals · 2 modifications

Diff: https://explore-openapi.dev/diff#...

Links:
All Project Snapshots · Base Branch Snapshot

@codecov
Copy link

codecov bot commented Nov 30, 2025

Codecov Report

❌ Patch coverage is 93.40659% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 54.44%. Comparing base (6e242bc) to head (7f9f115).
⚠️ Report is 1 commits behind head on trunk.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/Elasticsearch/Product/CustomFieldUpdater.php 91.66% 4 Missing ⚠️
...uct/Subscriber/CustomFieldSearchableSubscriber.php 95.83% 1 Missing ⚠️
...archableForExistingCustomFieldsInProductSearch.php 90.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #13749      +/-   ##
==========================================
+ Coverage   54.41%   54.44%   +0.03%     
==========================================
  Files        3204     3207       +3     
  Lines       96436    96525      +89     
==========================================
+ Hits        52474    52552      +78     
- Misses      43962    43973      +11     
Flag Coverage Δ
phpunit-migration 92.93% <94.73%> (+0.01%) ⬆️
phpunit-unit 52.13% <73.62%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@tamvt tamvt force-pushed the 13565/allow-configuration-of-custom-fields-to-be-searchable branch 2 times, most recently from 1855850 to dec1cfe Compare December 2, 2025 09:20
@tamvt tamvt linked an issue Dec 2, 2025 that may be closed by this pull request
@tamvt tamvt force-pushed the 13565/allow-configuration-of-custom-fields-to-be-searchable branch 4 times, most recently from 39dc0f5 to fed1935 Compare December 2, 2025 13:12
@vienthuong
Copy link
Contributor

Hey, could you provide some screenshots about your UI changes?

@tamvt tamvt force-pushed the 13565/allow-configuration-of-custom-fields-to-be-searchable branch 6 times, most recently from 1490c9b to 7c4db3c Compare December 9, 2025 10:14
@tamvt tamvt requested a review from nguyenquocdaile December 9, 2025 10:34
@nguyenquocdaile nguyenquocdaile force-pushed the 13565/allow-configuration-of-custom-fields-to-be-searchable branch 4 times, most recently from d24317b to b8dd8df Compare December 9, 2025 15:25
@tamvt tamvt requested review from jc-sw-git and mitelg December 22, 2025 03:57
@tamvt tamvt force-pushed the 13565/allow-configuration-of-custom-fields-to-be-searchable branch from b187f0e to 4267ac1 Compare December 23, 2025 10:33
@tamvt tamvt force-pushed the 13565/allow-configuration-of-custom-fields-to-be-searchable branch 2 times, most recently from 912d274 to ed2b924 Compare December 24, 2025 09:02
@tamvt tamvt force-pushed the 13565/allow-configuration-of-custom-fields-to-be-searchable branch from ed2b924 to c795186 Compare December 24, 2025 10:38
@tamvt tamvt enabled auto-merge December 24, 2025 10:56
@tamvt tamvt disabled auto-merge December 25, 2025 02:33
@tamvt tamvt requested review from jc-sw-git and removed request for jc-sw-git and mitelg December 25, 2025 02:35
@nguyenytran nguyenytran requested review from jc-sw-git and removed request for jc-sw-git December 25, 2025 04:01
@vienthuong vienthuong requested review from mitelg and removed request for mitelg December 25, 2025 04:02
@vienthuong vienthuong removed the request for review from jc-sw-git December 25, 2025 04:02
@vienthuong vienthuong enabled auto-merge December 25, 2025 04:02
@tamvt
Copy link
Contributor Author

tamvt commented Dec 25, 2025

Moved to this MR

@tamvt tamvt closed this Dec 25, 2025
auto-merge was automatically disabled December 25, 2025 05:17

Pull request was closed

@mitelg mitelg deleted the 13565/allow-configuration-of-custom-fields-to-be-searchable branch December 29, 2025 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/advanced-search component/search domain/inventory Responsible for managing products and everything product-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow Configuration of Custom Fields to be Searchable

10 participants