Skip to content

Commit 4b077d9

Browse files
authored
Merge pull request #2032 from shopware/13565/allow-configuration-of-custom-fields-to-be-searchable
feat: Allow Configuration of Custom Fields to be Searchable
2 parents 1e71d4d + 78ef186 commit 4b077d9

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

.wordlist.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1756,6 +1756,7 @@ scss
17561756
sdk
17571757
searchMedia
17581758
searchViaAdminApi
1759+
searchability
17591760
secretKey
17601761
selectable
17611762
selectbox

guides/plugins/plugins/framework/custom-field/add-custom-field.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ $this->customFieldSetRepository->create([
257257
[
258258
'name' => 'swag_example_size',
259259
'type' => CustomFieldTypes::INT,
260+
'includeInSearch' => true,
260261
'config' => [
261262
'label' => [
262263
'en-GB' => 'English custom field label',
@@ -277,6 +278,14 @@ The translated labels are added to both the field and the set, which are going t
277278

278279
If you have several custom fields and want to order them within a specific order, you can do so with the `customFieldPosition` property.
279280

281+
::: info
282+
Available starting with Shopware 6.7.6.0.
283+
:::
284+
285+
By default, custom fields are **not searchable**. To make a custom field searchable, you need to set the `includeInSearch` property to `true` when creating the custom field. Only custom fields explicitly marked as searchable are available in search configurations. This helps optimize index storage size and improve search performance, especially for stores with many custom fields.
286+
287+
If you enable searchability for an existing product custom field, you must rebuild the search index or update the products manually to include the custom field data in search results.
288+
280289
::: info
281290
If you want the custom field set to be deletable and editable in the administration, you need to set global to false
282291
:::

0 commit comments

Comments
 (0)