From edb7b6d7b4345e0c272231ac6de4ccb74061ee1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 2 Jul 2025 16:35:15 +0200 Subject: [PATCH 01/15] Adjusted code samples --- .../discounts/src/Command/ManageDiscountsCommand.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/code_samples/discounts/src/Command/ManageDiscountsCommand.php b/code_samples/discounts/src/Command/ManageDiscountsCommand.php index 6243da8ca6..27dadd7dd0 100644 --- a/code_samples/discounts/src/Command/ManageDiscountsCommand.php +++ b/code_samples/discounts/src/Command/ManageDiscountsCommand.php @@ -59,7 +59,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int $discountCodeCreateStruct = new DiscountCodeCreateStruct( 'summer10', - null, // Unlimited usage + 10, // Global usage limit + null, // Unlimited usage per customer $this->permissionResolver->getCurrentUserReference()->getUserId(), $now ); @@ -78,7 +79,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int new IsInRegions(['germany', 'france']), new IsProductInArray(['product-1', 'product-2']), new IsInCurrency('EUR'), - new IsValidDiscountCode($discountCode->getCode(), $discountCode->getUsedLimit()), + new IsValidDiscountCode($discountCode->getCode(), $discountCode->getGlobalLimit(), $discountCode->getUsedLimit()), ]) ->setTranslations([ new DiscountTranslationStruct('eng-GB', 'Discount name', 'This is a discount description', 'Promotion Label', 'Promotion Description'), From 61678933bfeeccb100a8839c9336a95119f60c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 2 Jul 2025 17:48:35 +0200 Subject: [PATCH 02/15] [Discounts] Added doc for 4.6.22 --- .../discounts/discount_code_create.yaml | 7 ++++ docs/api/event_reference/discounts_events.md | 18 +++++---- .../data_migration/importing_data.md | 9 +++++ docs/discounts/discounts_guide.md | 4 +- docs/release_notes/ibexa_dxp_v4.6.md | 38 +++++++++++++++++++ .../discounts_sort_clauses.md | 1 + .../from_4.6/update_from_4.6.md | 22 +++++++++++ 7 files changed, 90 insertions(+), 9 deletions(-) create mode 100644 code_samples/data_migration/examples/discounts/discount_code_create.yaml diff --git a/code_samples/data_migration/examples/discounts/discount_code_create.yaml b/code_samples/data_migration/examples/discounts/discount_code_create.yaml new file mode 100644 index 0000000000..c919459d49 --- /dev/null +++ b/code_samples/data_migration/examples/discounts/discount_code_create.yaml @@ -0,0 +1,7 @@ +type: discount_code +mode: create +code: TEST_CODE +global_usage_limit: 100 # Optional +user_usage_limit: 5 # Optional +created_at: '2023-01-01T12:00:00+00:00' # Optional +creator_id: 42 # Optional diff --git a/docs/api/event_reference/discounts_events.md b/docs/api/event_reference/discounts_events.md index f33e24214c..c3a30584b0 100644 --- a/docs/api/event_reference/discounts_events.md +++ b/docs/api/event_reference/discounts_events.md @@ -13,14 +13,16 @@ month_change: true The events below are dispatched when managing [discounts](discounts_guide.md): -| Event | Dispatched by | -|---|---| -|[BeforeCreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeCreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) -|[CreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-CreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) -|[BeforeDeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeDeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) -|[DeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-DeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) -|[BeforeUpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeUpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)| -|[UpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-UpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)| +| Event | Dispatched by | Description | +|---|---|---| +|[BeforeCreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeCreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched before a discount is created. | +|[CreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-CreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched after a discount is created. | +|[BeforeDeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeDeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched before a discount is deleted. | +|[DeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-DeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched after a discount is deleted. | +|[BeforeUpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeUpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)| Dispatched before a discount is updated. | +|[UpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-UpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched after a discount is updated. | +|[OverridePrioritizationOnCreateEvent](TODO)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)| Dispatched before a discount is created. Use it to set the `overridePrioritization` property to give a discount [higher priority](discounts_guide.md#discounts-priority). | +|[OverridePrioritizationOnUpdateEvent](TODO)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)| Dispatched before a discount is updated. Use it to set the `overridePrioritization` property to give a discount [higher priority](discounts_guide.md#discounts-priority). | ## Form events diff --git a/docs/content_management/data_migration/importing_data.md b/docs/content_management/data_migration/importing_data.md index 21abb9ab84..4774b36646 100644 --- a/docs/content_management/data_migration/importing_data.md +++ b/docs/content_management/data_migration/importing_data.md @@ -56,6 +56,7 @@ The following data migration step modes are available: | `currency` | ✔ | ✔ | ✔ | | | `customer_group` | ✔ | ✔ | ✔ | | | `discount` | ✔ | ✔ | | | +| `discount_code` | ✔ | | | | | `language` | ✔ | | | | | `location` | | ✔ | | ✔ | | `object_state` | ✔ | | | | @@ -525,6 +526,14 @@ The provided conditions overwrite any already existing ones. For a list of available conditions, see [Discounts API](discounts_api.md#conditions). +### Discount codes [[% include 'snippets/lts-update_badge.md' %]] + +You can create a discount code as in the following example: + +``` yaml +[[= include_file('code_samples/data_migration/examples/discounts/discount_code_create.yaml') =]] +``` + ## Criteria When using `update` or `delete` modes, you can use criteria to identify the objects to operate on. diff --git a/docs/discounts/discounts_guide.md b/docs/discounts/discounts_guide.md index 7c0364bb2f..8c38df6532 100644 --- a/docs/discounts/discounts_guide.md +++ b/docs/discounts/discounts_guide.md @@ -59,6 +59,7 @@ A shopping cart can have multiple active discounts, but a specific product can o When two or more discounts can be applied to a single product, the system evaluates the following properties to choose the right one: +- discount code existence (discounts with discount codes have priority over the others) - discount activation place (cart discounts rank higher over catalog discounts) - discount priority (higher priority ranks higher) - discount creation date (newer discounts rank higher) @@ -107,7 +108,8 @@ These conditions can include: For **cart discounts**, you can specify an additional text value that needs to be entered in the cart for the discount to apply. -The discount code usage can be limited per customer: +The discount code usage can be limited globally, for example by making the discount valid only for the first 10 customers using it before it expires. +You can also limit the usage per customer: - single use: every customer can use this code only once - limited use: every customer can use the code a specified number of times diff --git a/docs/release_notes/ibexa_dxp_v4.6.md b/docs/release_notes/ibexa_dxp_v4.6.md index 477a54b753..a89892caa0 100644 --- a/docs/release_notes/ibexa_dxp_v4.6.md +++ b/docs/release_notes/ibexa_dxp_v4.6.md @@ -10,6 +10,44 @@ month_change: true
+[[% set version = 'v4.6.22' %]] +[[= release_note_entry_begin("Discounts " + version, 'TODO', ['LTS Update', 'Commerce']) =]] + +#### Global discount codes + +- You can now [limit the number of times](discounts_guide.md#discount-codes) a discount code can be used before it expires + +#### Discount codes prioritization + +- Discounts with discount codes now have priority over the other discounts + +#### Discount codes migrations + +- You can now create discount codes using [data migrations](importing_data.md#discount-codes). + +#### PHP API + +The PHP API has been enhanced with the following new classes: + +- TODO + +[[= release_note_entry_end() =]] +[[= release_note_entry_begin("Ibexa DXP " + version, 'TODO', ['Headless', 'Experience', 'Commerce']) =]] + +#### TODO + +#### PHP API + +The PHP API has been enhanced with the following new classes: + +- TODO + +#### Full changelog +[[% include 'snippets/release_46.md' %]] +[[= release_note_entry_end() =]] + + + [[% set version = 'v4.6.21' %]] [[= release_note_entry_begin("Discounts " + version, '2025-06-11', ['LTS Update', 'Commerce']) =]] diff --git a/docs/search/discounts_search_reference/discounts_sort_clauses.md b/docs/search/discounts_search_reference/discounts_sort_clauses.md index a25c26a6d0..fb6ba17f5f 100644 --- a/docs/search/discounts_search_reference/discounts_sort_clauses.md +++ b/docs/search/discounts_search_reference/discounts_sort_clauses.md @@ -15,6 +15,7 @@ Sort Clauses are found in the [`Ibexa\Contracts\Discounts\Value\Query\SortClause | [EndDate](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-EndDate.html)| Sort by discount's end date | | [Id](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Id.html)| Sort by discount's database ID | | [Identifier](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Identifier.html)| Sort by discount identifier | +| [OverridePrioritization](TODO: PHP REF LINK) | Sort by the discount's `overridePrioritization` property. | | [Priority](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Priority.html)| Sort by discount priority | | [StartDate](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-StartDate.html)| Sort by discount start date | | [Type](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Type.html)| Sort by the place where the discount activates: catalog or cart. When sorting with ascending order, cart discounts are returned first. | diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index c8d1cfbcab..e926fadb0f 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -522,6 +522,28 @@ To use the [latest features](ibexa_dxp_v4.6.md) added to them, update them separ REFERENCES ezuser (contentobject_id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE; ``` + ## 4.6.22 + + ### Database update + + Run the following scripts: + + === "MySQL" + + ``` sql + ALTER TABLE ibexa_discount ADD override_prioritization tinyint(1) NOT NULL DEFAULT 0; + CREATE INDEX ibexa_discount_prioritization_idx ON ibexa_discount (override_prioritization, type, priority); + ALTER TABLE ibexa_discount_code ADD global_limit INT DEFAULT NULL; + ``` + + === "PostgreSQL" + + ``` sql + ALTER TABLE ibexa_discount ADD override_prioritization tinyint(1) NOT NULL DEFAULT 0; + CREATE INDEX ibexa_discount_prioritization_idx ON ibexa_discount (override_prioritization, type, priority); + ALTER TABLE ibexa_discount_code ADD global_limit INT DEFAULT NULL; + ``` + === "AI actions" Run the following command to get the latest version: From 9dd8df4c647df134e07d51f11f4e305ba71e0e89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 2 Jul 2025 17:54:32 +0200 Subject: [PATCH 03/15] Fixed limit mention --- docs/discounts/discounts_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/discounts/discounts_api.md b/docs/discounts/discounts_api.md index cb0fc19931..e6dbc6af9c 100644 --- a/docs/discounts/discounts_api.md +++ b/docs/discounts/discounts_api.md @@ -113,7 +113,7 @@ The example below contains a Command creating a cart discount. The discount: - [depends](#conditions) on - being bought from Germany or France - 2 products - - a `summer10` [discount code](#discount-codes) which can be used unlimited number of times + - a `summer10` [discount code](#discount-codes) which can be used only 10 times, but a single customer can use the code multiple times ``` php hl_lines="60-66 68-92" [[= include_file('code_samples/discounts/src/Command/ManageDiscountsCommand.php') =]] From 4d3d3ab0b7371219fcab3229b5e3622511ed0cca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 2 Jul 2025 18:01:41 +0200 Subject: [PATCH 04/15] Added update mention --- docs/update_and_migration/from_4.6/update_from_4.6.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index e926fadb0f..22701fce4c 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -372,6 +372,10 @@ Run the following scripts: psql < vendor/ibexa/installer/upgrade/db/postgresql/ibexa-4.6.20-to-4.6.21.sql ``` +## v4.6.22 + +No additional steps needed. + [[% include 'snippets/update/notify_support.md' %]] With the product updated to the latest version, you can now finish the update process or proceed to updating the LTS Updates packages. From 0a6fef7dcb9d8487ebd9ddc2bf1eff127434937b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 3 Jul 2025 09:12:32 +0200 Subject: [PATCH 05/15] Removed mentions of OverridePrioritatization --- docs/api/event_reference/discounts_events.md | 18 ++++++++---------- .../discounts_sort_clauses.md | 1 - 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/docs/api/event_reference/discounts_events.md b/docs/api/event_reference/discounts_events.md index c3a30584b0..5a7098e23e 100644 --- a/docs/api/event_reference/discounts_events.md +++ b/docs/api/event_reference/discounts_events.md @@ -13,16 +13,14 @@ month_change: true The events below are dispatched when managing [discounts](discounts_guide.md): -| Event | Dispatched by | Description | -|---|---|---| -|[BeforeCreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeCreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched before a discount is created. | -|[CreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-CreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched after a discount is created. | -|[BeforeDeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeDeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched before a discount is deleted. | -|[DeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-DeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched after a discount is deleted. | -|[BeforeUpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeUpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)| Dispatched before a discount is updated. | -|[UpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-UpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | Dispatched after a discount is updated. | -|[OverridePrioritizationOnCreateEvent](TODO)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)| Dispatched before a discount is created. Use it to set the `overridePrioritization` property to give a discount [higher priority](discounts_guide.md#discounts-priority). | -|[OverridePrioritizationOnUpdateEvent](TODO)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)| Dispatched before a discount is updated. Use it to set the `overridePrioritization` property to give a discount [higher priority](discounts_guide.md#discounts-priority). | +| Event | Dispatched by | +|---|---| +|[BeforeCreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeCreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | +|[CreateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-CreateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | +|[BeforeDeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeDeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | +|[DeleteDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-DeleteDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | +|[BeforeUpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-BeforeUpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html)| +|[UpdateDiscountEvent](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Event-UpdateDiscountEvent.html)| [DiscountServiceInterface](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-DiscountServiceInterface.html) | ## Form events diff --git a/docs/search/discounts_search_reference/discounts_sort_clauses.md b/docs/search/discounts_search_reference/discounts_sort_clauses.md index fb6ba17f5f..a25c26a6d0 100644 --- a/docs/search/discounts_search_reference/discounts_sort_clauses.md +++ b/docs/search/discounts_search_reference/discounts_sort_clauses.md @@ -15,7 +15,6 @@ Sort Clauses are found in the [`Ibexa\Contracts\Discounts\Value\Query\SortClause | [EndDate](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-EndDate.html)| Sort by discount's end date | | [Id](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Id.html)| Sort by discount's database ID | | [Identifier](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Identifier.html)| Sort by discount identifier | -| [OverridePrioritization](TODO: PHP REF LINK) | Sort by the discount's `overridePrioritization` property. | | [Priority](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Priority.html)| Sort by discount priority | | [StartDate](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-StartDate.html)| Sort by discount start date | | [Type](/api/php_api/php_api_reference/classes/Ibexa-Contracts-Discounts-Value-Query-SortClause-Type.html)| Sort by the place where the discount activates: catalog or cart. When sorting with ascending order, cart discounts are returned first. | From e0f2cac1115d0fc35ba2af48f6e326a59c3e99a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 3 Jul 2025 09:15:40 +0200 Subject: [PATCH 06/15] Wording --- docs/discounts/discounts_guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/discounts/discounts_guide.md b/docs/discounts/discounts_guide.md index 8c38df6532..71a1eef50d 100644 --- a/docs/discounts/discounts_guide.md +++ b/docs/discounts/discounts_guide.md @@ -108,7 +108,7 @@ These conditions can include: For **cart discounts**, you can specify an additional text value that needs to be entered in the cart for the discount to apply. -The discount code usage can be limited globally, for example by making the discount valid only for the first 10 customers using it before it expires. +The discount code usage can be limited globally, for example by making the discount valid only for the first 10 customers before it expires. You can also limit the usage per customer: - single use: every customer can use this code only once From 4aaaca25c00d878c463734eda3a0d766e0dee5a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 3 Jul 2025 09:25:52 +0200 Subject: [PATCH 07/15] Update code_samples/discounts/src/Command/ManageDiscountsCommand.php Co-authored-by: Konrad Oboza --- .../discounts/src/Command/ManageDiscountsCommand.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code_samples/discounts/src/Command/ManageDiscountsCommand.php b/code_samples/discounts/src/Command/ManageDiscountsCommand.php index 27dadd7dd0..0471f80201 100644 --- a/code_samples/discounts/src/Command/ManageDiscountsCommand.php +++ b/code_samples/discounts/src/Command/ManageDiscountsCommand.php @@ -79,7 +79,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int new IsInRegions(['germany', 'france']), new IsProductInArray(['product-1', 'product-2']), new IsInCurrency('EUR'), - new IsValidDiscountCode($discountCode->getCode(), $discountCode->getGlobalLimit(), $discountCode->getUsedLimit()), + new IsValidDiscountCode( + $discountCode->getCode(), + $discountCode->getGlobalLimit(), + $discountCode->getUsedLimit() + ), ]) ->setTranslations([ new DiscountTranslationStruct('eng-GB', 'Discount name', 'This is a discount description', 'Promotion Label', 'Promotion Description'), From 73658111f26cdc65eba5ab4d505e60e621f81041 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 3 Jul 2025 09:28:01 +0200 Subject: [PATCH 08/15] Fixed highlights --- docs/discounts/discounts_api.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/discounts/discounts_api.md b/docs/discounts/discounts_api.md index e6dbc6af9c..d8ab35759c 100644 --- a/docs/discounts/discounts_api.md +++ b/docs/discounts/discounts_api.md @@ -115,7 +115,7 @@ The example below contains a Command creating a cart discount. The discount: - 2 products - a `summer10` [discount code](#discount-codes) which can be used only 10 times, but a single customer can use the code multiple times -``` php hl_lines="60-66 68-92" +``` php hl_lines="60-67 69-97" [[= include_file('code_samples/discounts/src/Command/ManageDiscountsCommand.php') =]] ``` From 87fbf3e2ec313310341377b33e134f6309a93bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 3 Jul 2025 12:07:03 +0200 Subject: [PATCH 09/15] Review suggestions --- .../examples/discounts/discount_code_create.yaml | 2 +- docs/release_notes/ibexa_dxp_v4.6.md | 7 +++---- docs/update_and_migration/from_4.6/update_from_4.6.md | 10 +++++----- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/code_samples/data_migration/examples/discounts/discount_code_create.yaml b/code_samples/data_migration/examples/discounts/discount_code_create.yaml index c919459d49..7b2358d364 100644 --- a/code_samples/data_migration/examples/discounts/discount_code_create.yaml +++ b/code_samples/data_migration/examples/discounts/discount_code_create.yaml @@ -1,6 +1,6 @@ type: discount_code mode: create -code: TEST_CODE +code: summer10 global_usage_limit: 100 # Optional user_usage_limit: 5 # Optional created_at: '2023-01-01T12:00:00+00:00' # Optional diff --git a/docs/release_notes/ibexa_dxp_v4.6.md b/docs/release_notes/ibexa_dxp_v4.6.md index a89892caa0..98e66e2ca3 100644 --- a/docs/release_notes/ibexa_dxp_v4.6.md +++ b/docs/release_notes/ibexa_dxp_v4.6.md @@ -13,9 +13,9 @@ month_change: true [[% set version = 'v4.6.22' %]] [[= release_note_entry_begin("Discounts " + version, 'TODO', ['LTS Update', 'Commerce']) =]] -#### Global discount codes +#### Global discount codes limits -- You can now [limit the number of times](discounts_guide.md#discount-codes) a discount code can be used before it expires +- You can now [limit the number of times](discounts_guide.md#discount-codes) a discount code can be used before it expires. The discounts created before this release are set to unlimited global usage #### Discount codes prioritization @@ -43,11 +43,10 @@ The PHP API has been enhanced with the following new classes: - TODO #### Full changelog + [[% include 'snippets/release_46.md' %]] [[= release_note_entry_end() =]] - - [[% set version = 'v4.6.21' %]] [[= release_note_entry_begin("Discounts " + version, '2025-06-11', ['LTS Update', 'Commerce']) =]] diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index 22701fce4c..2eacfe972a 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -395,16 +395,16 @@ To use the [latest features](ibexa_dxp_v4.6.md) added to them, update them separ Then apply manually the changes described below. - ## 4.6.20 + ### Discounts 4.6.20 - ### Policy changes + #### Policy changes The `discount/view` policy is no longer required for the store customers to use a discount and must be removed from all users who are not managing discounts. The policy allows to access all the discount details, including the coupon codes to activate them, which could lead to system abuse. To learn more, see the [discounts policies overview](policies.md#discounts). - ### Database update + #### Database update Run the following scripts: @@ -526,9 +526,9 @@ To use the [latest features](ibexa_dxp_v4.6.md) added to them, update them separ REFERENCES ezuser (contentobject_id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE; ``` - ## 4.6.22 + ### Discounts 4.6.22 - ### Database update + #### Database update Run the following scripts: From 3386a3fe93667c039324d91c77412c6e10c77e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Thu, 10 Jul 2025 10:14:09 +0200 Subject: [PATCH 10/15] Added missing v prefix --- docs/update_and_migration/from_4.6/update_from_4.6.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index 2eacfe972a..a4aa8cad2d 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -395,7 +395,7 @@ To use the [latest features](ibexa_dxp_v4.6.md) added to them, update them separ Then apply manually the changes described below. - ### Discounts 4.6.20 + ### Discounts v4.6.20 #### Policy changes @@ -526,7 +526,7 @@ To use the [latest features](ibexa_dxp_v4.6.md) added to them, update them separ REFERENCES ezuser (contentobject_id) ON UPDATE CASCADE ON DELETE CASCADE NOT DEFERRABLE INITIALLY IMMEDIATE; ``` - ### Discounts 4.6.22 + ### Discounts v4.6.22 #### Database update From d84be3e8f97dd13fcf64f437d66a8cd466ac40cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Mon, 4 Aug 2025 18:03:53 +0200 Subject: [PATCH 11/15] Described requirements --- docs/getting_started/requirements.md | 63 ++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 8 deletions(-) diff --git a/docs/getting_started/requirements.md b/docs/getting_started/requirements.md index ed4dc19758..d20675dece 100644 --- a/docs/getting_started/requirements.md +++ b/docs/getting_started/requirements.md @@ -125,6 +125,10 @@ For production setups it's recommended that you use Varnish/Fastly, Redis, NFS/E ## PHP +=== "[[= product_name =]] v4.6" + + - 8.3 + === "[[= product_name =]] v4.6" - 8.3 @@ -208,25 +212,54 @@ For production setups it's recommended that you use Varnish/Fastly, Redis, NFS/E === "[[= product_name =]] v5.0" - - For content search, Solr 8.11.1 or higher. - Alternatively, Elasticsearch 7.16.2 or higher 7.x version. + |Name|Version| + |---|---| + |Solr|8.11.1+ or 9.8.1+| + |Elasticsearch| 7.16.2+ | + + If you see a "+" next to the product version, it indicates a recommended version or higher within the same major release. + For example, "1.18+" means any 1.x version equal to or higher than 1.18, but not 2.x. === "[[= product_name =]] v4.6" - - For content search, Solr 7.7 LTS or Solr 8, recommended 8.11.1 or higher. - Alternatively, Elasticsearch 7.16.2 or higher 7.x version. - - The above solutions require Oracle Java/Open JDK. The minimum requirement is 8 LTS, recommended 11 LTS. - Newer versions aren't supported. + |Name|Version| + |---|---| + |Solr|8.11.1+ or 9.8.1+| + |Elasticsearch| 7.16.2+ | + + If you see a "+" next to the product version, it indicates a recommended version or higher within the same major release. + For example, "1.18+" means any 1.x version equal to or higher than 1.18, but not 2.x. === "[[= product_name =]] v3.3" - - For content search, Solr 7.7 LTS or Solr 8, recommended 8.11.1 or higher. - Alternatively, Elasticsearch 7.16.2 or higher 7.x version. + |Name|Version| + |---|---| + |Solr|7.7 LTS or 8.11.1+| + |Elasticsearch| 7.16.2+ | + + If you see a "+" next to the product version, it indicates a recommended version or higher within the same major release. + For example, "1.18+" means any 1.x version equal to or higher than 1.18, but not 2.x. + - For BinaryFile field indexing, Apache Tika 1.20 or higher 1.x version, recommended 1.28.1 or higher. - The above solutions require Oracle Java/Open JDK. The minimum requirement is 8 LTS, recommended 11 LTS. Newer versions aren't supported. ## Graphic Handler +=== "[[= product_name =]] v5.0" + + - GraphicsMagick + - ImageMagick + - GD + + Optionally if you intend to edit [PNG, SVG, GIF or WEBP files in the Image Editor](images.md#image-optimization), or use it with image variations: + + - JpegOptim + - Optipng + - Pngquant 2 + - SVGO 1 + - Gifsicle + - cwebp + === "[[= product_name =]] v4.6" - GraphicsMagick @@ -288,6 +321,10 @@ For production setups it's recommended that you use Varnish/Fastly, Redis, NFS/E ## Filesystem +=== "[[= product_name =]] v5.0" + + - Linux ext4 / XFS + === "[[= product_name =]] v4.6" - Linux ext4 / XFS @@ -339,6 +376,16 @@ For production setups it's recommended that you use Varnish/Fastly, Redis, NFS/E ## Browser +=== "[[= product_name =]] v5.0" + + [[= product_name =]] is developed to work with *any* web browser that supports modern standards, on *any* screen resolution suitable for web, running on *any* device. + However for the Editorial and Administration User Interfaces you need: a minimum of 1366-by-768 screen resolution, a desktop or tablet device, and a recommended/supported browser among the ones found below. + + - Mozilla® Firefox® most recent stable version (recommended) + - Google Chrome™ most recent stable version (recommended) + - Chromium™ based browsers such as Microsoft® Edge® and Opera®, most recent stable version, desktop *and* tablet + - Apple® Safari® most recent stable version, desktop *and* tablet + === "[[= product_name =]] v4.6" [[= product_name =]] is developed to work with *any* web browser that supports modern standards, on *any* screen resolution suitable for web, running on *any* device. From 85980e8dfb589efe86007e1ca49e3970ee43d327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Mon, 4 Aug 2025 20:01:31 +0200 Subject: [PATCH 12/15] Added Solr 9 instructions --- docs/release_notes/ibexa_dxp_v4.6.md | 6 +- .../solr_search_engine/install_solr.md | 86 +++++++++++++++---- .../from_4.6/update_from_4.6.md | 17 +++- 3 files changed, 89 insertions(+), 20 deletions(-) diff --git a/docs/release_notes/ibexa_dxp_v4.6.md b/docs/release_notes/ibexa_dxp_v4.6.md index 98e66e2ca3..b71ffff9c0 100644 --- a/docs/release_notes/ibexa_dxp_v4.6.md +++ b/docs/release_notes/ibexa_dxp_v4.6.md @@ -34,7 +34,11 @@ The PHP API has been enhanced with the following new classes: [[= release_note_entry_end() =]] [[= release_note_entry_begin("Ibexa DXP " + version, 'TODO', ['Headless', 'Experience', 'Commerce']) =]] -#### TODO +#### Support for Solr 9 + +This release comes with support for [Solr 9](https://nightlies.apache.org/solr/draft-guides/solr-reference-guide-antora/solr/10_0/upgrade-notes/major-changes-in-solr-9.html). + +Solr 9 comes with support for [Dense Vector Search](https://solr.apache.org/guide/solr/latest/query-guide/dense-vector-search.html), paving the way for incoming improvements to [AI Actions](ai_actions.md) in [[= product_name =]]. #### PHP API diff --git a/docs/search/search_engines/solr_search_engine/install_solr.md b/docs/search/search_engines/solr_search_engine/install_solr.md index fd619b8ab5..ff159b7ffb 100644 --- a/docs/search/search_engines/solr_search_engine/install_solr.md +++ b/docs/search/search_engines/solr_search_engine/install_solr.md @@ -13,30 +13,69 @@ For configuring Solr in other ways, including examples, see [Solr Cores and `sol !!! note "Solr versions" - Supported Solr versions are Solr 7 and 8. Using most recent version of Solr 7.7 or 8.11 is recommended. + Supported Solr versions are Solr 7, 8 and 9. Using the most recent version of Solr is recommended. Download and extract Solr: - [solr-7.7.2.tgz](http://archive.apache.org/dist/lucene/solr/7.7.2/solr-7.7.2.tgz) or [solr-7.7.2.zip](http://archive.apache.org/dist/lucene/solr/7.7.2/solr-7.7.2.zip) - [solr-8.11.2.tgz](https://www.apache.org/dyn/closer.lua/lucene/solr/8.11.2/solr-8.11.2.tgz) or [solr-8.11.2.zip](https://www.apache.org/dyn/closer.lua/lucene/solr/8.11.2/solr-8.11.2.zip) +- [solr-9.8.1.tgz](https://archive.apache.org/dist/solr/solr/9.8.1/solr-9.8.1.tgz) -Copy the necessary configuration files. In the example below from the root of your project to the place you extracted Solr: +Copy the necessary configuration files. +The examples below copy from the root of your DXP project to the place you've extracted Solr: -``` bash -# Make sure to replace the /opt/solr/ path with where you have placed Solr -cd /opt/solr -mkdir -p server/ibexa/template -cp -R /vendor/ibexa/solr/src/lib/Resources/config/solr/* server/ibexa/template -cp server/solr/configsets/_default/conf/{solrconfig.xml,stopwords.txt,synonyms.txt} server/ibexa/template -cp server/solr/solr.xml server/ibexa - -# Modify solrconfig.xml to remove the section that doesn't agree with your schema -sed -i.bak '//d' server/ibexa/template/solrconfig.xml - -# Start Solr (but apply autocommit settings below first if you need to) -bin/solr -s ibexa -bin/solr create_core -c collection1 -d server/ibexa/template -``` +=== "Solr 9" + + [[= product_name =]] provides the following required configuration files: + + - `vendor/ibexa/solr/src/lib/Resources/config/solr/solr.languages` directory + - `vendor/ibexa/solr/src/lib/Resources/config/solr/managed-schema.xml` + - `vendor/ibexa/solr/src/lib/Resources/config/solr/custom-fields-types-solr9.xml` + - `vendor/ibexa/solr/src/lib/Resources/config/solr/language-fieldtypes.xml` + + + ``` bash + # Make sure to replace the /opt/solr/ path with where you have placed Solr + cd /opt/solr + mkdir -p server/ibexa/template + cp -R /vendor/ibexa/solr/src/lib/Resources/config/solr/solr.languages server/ibexa/template + cp -R /vendor/ibexa/solr/src/lib/Resources/config/solr/{managed-schema.xml,custom-fields-types-solr9.xml,language-fieldtypes.xml} server/ibexa/template + cp server/solr/configsets/_default/conf/{solrconfig.xml,stopwords.txt,synonyms.txt} server/ibexa/template + cp server/solr/solr.xml server/ibexa + + # Modify solrconfig.xml to remove the section that doesn't agree with your schema + sed -i.bak '//d' server/ibexa/template/solrconfig.xml + + # Start Solr (but apply autocommit settings below first if you need to) + bin/solr -s ibexa + bin/solr create_core -c collection1 -d server/ibexa/template + ``` + +=== "Solr 7 and 8" + + [[= product_name =]] provides the following required configuration files: + + - `vendor/ibexa/solr/src/lib/Resources/config/solr/solr.languages` directory + - `vendor/ibexa/solr/src/lib/Resources/config/solr/schema.xml` + - `vendor/ibexa/solr/src/lib/Resources/config/solr/custom-fields-types.xml` + - `vendor/ibexa/solr/src/lib/Resources/config/solr/language-fieldtypes.xml` + + ``` bash + # Make sure to replace the /opt/solr/ path with where you have placed Solr + cd /opt/solr + mkdir -p server/ibexa/template + cp -R /vendor/ibexa/solr/src/lib/Resources/config/solr/solr.languages server/ibexa/template + cp -R /vendor/ibexa/solr/src/lib/Resources/config/solr/{schema.xml,custom-fields-types.xml,language-fieldtypes.xml} server/ibexa/template + cp server/solr/configsets/_default/conf/{solrconfig.xml,stopwords.txt,synonyms.txt} server/ibexa/template + cp server/solr/solr.xml server/ibexa + + # Modify solrconfig.xml to remove the section that doesn't agree with your schema + sed -i.bak '//d' server/ibexa/template/solrconfig.xml + + # Start Solr (but apply autocommit settings below first if you need to) + bin/solr -s ibexa + bin/solr create_core -c collection1 -d server/ibexa/template + ``` #### Set up SolrCloud @@ -71,7 +110,7 @@ It's strongly recommended to set-up `solrconfig.xml` like this: ### Generate Solr configuration automatically -The command line tool `bin/generate-solr-config.sh` generates Solr 7 configuration automatically. +The command line tool `bin/generate-solr-config.sh` generates Solr configuration automatically. It can be used for deploying to [[= product_name_cloud =]] (Platform.sh) and on-premise installs. Execute the script from the [[= product_name =]] root directory for further information: @@ -91,6 +130,16 @@ The config further below assumes you have parameters set up for Solr DSN and sea env(SOLR_CORE): collection1 ``` +### Configure Solr version + +When using Solr 9, it's required to set the `version` parameter with the Solr version. +The parameter is optional when using lower Solr versions. + +``` yaml +ibexa_solr: + version: '9.8.1' +``` + ### Single-core example (default) Out of the box in [[= product_name =]] the following is enabled for a setup: @@ -145,6 +194,7 @@ If full language analysis features are preferred, then each language can be conf ``` yaml ibexa_solr: + version: '9.8.1' # Required only if using Solr 9 endpoints: endpoint0: dsn: '%solr_dsn%' diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index a4aa8cad2d..002aff9aa6 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -374,7 +374,22 @@ Run the following scripts: ## v4.6.22 -No additional steps needed. +### Added support for Solr 9 + +This release adds support for [Solr 9](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html). + +To update Solr within an existing [[= product_name =]] project, first refer to the [Solr 9 upgrade planning](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html) instruction. + +Then, perform the following additional actions: + +1. Adjust the configuration files: + + - rename the `schema.xml` configuration file to [`managed-schema.xml`](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-6.html#managed-schema-is-now-the-default) + - replace the contents of `custom-field-types.xml` [with the new content](https://github.com/ibexa/solr/blob/v4.6.22/src/lib/Resources/config/solr/custom-fields-types-solr9.xml), replacing the [removed `LatLonType` with the `LatLonPointSpatialField` field](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-7.html#deprecations-and-removed-features) + +1. Configure the [Solr version in the project](install_solr.md#configure-solr-version). + +1. Finish the update by [refreshing the search index](reindex_search.md). [[% include 'snippets/update/notify_support.md' %]] From 1522ce3be0419dcd4c77debd184a7b1247c1bdbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 5 Aug 2025 09:03:45 +0200 Subject: [PATCH 13/15] Fixed link --- docs/update_and_migration/from_4.6/update_from_4.6.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index 002aff9aa6..c522b2508a 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -376,7 +376,7 @@ Run the following scripts: ### Added support for Solr 9 -This release adds support for [Solr 9](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html). +This release adds support for [Solr 9](requirements.md#search). To update Solr within an existing [[= product_name =]] project, first refer to the [Solr 9 upgrade planning](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html) instruction. From 13ce07119342adfe61f9722595fbb8673eedbc7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 5 Aug 2025 12:51:33 +0200 Subject: [PATCH 14/15] Updated instructions --- .../solr_search_engine/install_solr.md | 47 ++++++++++++++++--- .../from_4.6/update_from_4.6.md | 16 ++++--- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/docs/search/search_engines/solr_search_engine/install_solr.md b/docs/search/search_engines/solr_search_engine/install_solr.md index ff159b7ffb..00c97c1ea0 100644 --- a/docs/search/search_engines/solr_search_engine/install_solr.md +++ b/docs/search/search_engines/solr_search_engine/install_solr.md @@ -37,18 +37,19 @@ The examples below copy from the root of your DXP project to the place you've ex ``` bash # Make sure to replace the /opt/solr/ path with where you have placed Solr cd /opt/solr - mkdir -p server/ibexa/template - cp -R /vendor/ibexa/solr/src/lib/Resources/config/solr/solr.languages server/ibexa/template - cp -R /vendor/ibexa/solr/src/lib/Resources/config/solr/{managed-schema.xml,custom-fields-types-solr9.xml,language-fieldtypes.xml} server/ibexa/template - cp server/solr/configsets/_default/conf/{solrconfig.xml,stopwords.txt,synonyms.txt} server/ibexa/template + mkdir -p server/ibexa/template/conf + cp -R /vendor/ibexa/solr/src/lib/Resources/config/solr/solr.languages server/ibexa/template/conf + cp -R /vendor/ibexa/solr/src/lib/Resources/config/solr/{managed-schema.xml,custom-fields-types-solr9.xml,language-fieldtypes.xml} server/ibexa/template/conf + cp server/solr/configsets/_default/conf/{solrconfig.xml,stopwords.txt,synonyms.txt} server/ibexa/template/conf cp server/solr/solr.xml server/ibexa # Modify solrconfig.xml to remove the section that doesn't agree with your schema - sed -i.bak '//d' server/ibexa/template/solrconfig.xml + sed -i.bak '//d' server/ibexa/template/conf/solrconfig.xml # Start Solr (but apply autocommit settings below first if you need to) + # The configuration path is an absolute path bin/solr -s ibexa - bin/solr create_core -c collection1 -d server/ibexa/template + bin/solr create_core -c collection1 -d /opt/solr/server/ibexa/template ``` === "Solr 7 and 8" @@ -89,6 +90,8 @@ To set SolrCloud up follow [SolrCloud reference guide](https://solr.apache.org/g ### Continue Solr configuration +#### Configure commit frequency + The bundle doesn't commit Solr index changes directly on repository updates, leaving it up to you to tune this using `solrconfig.xml` as best practice suggests. This setting is **required** if you want to see the changes after publish. @@ -108,6 +111,38 @@ It's strongly recommended to set-up `solrconfig.xml` like this: ``` +#### Configure spellcheck + +Configure the spellcheck component in `solrconfig.xml`: + +```xml + + + default + meta_content__text_t + solr.DirectSolrSpellChecker + internal + 0.5 + 2 + 1 + 5 + 4 + 0.01 + + +``` + +Add this `spellcheck` component to the `/select` request handler: + +```xml + + + spellcheck + + + +``` + ### Generate Solr configuration automatically The command line tool `bin/generate-solr-config.sh` generates Solr configuration automatically. diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index c522b2508a..c4b7b524e2 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -378,18 +378,20 @@ Run the following scripts: This release adds support for [Solr 9](requirements.md#search). -To update Solr within an existing [[= product_name =]] project, first refer to the [Solr 9 upgrade planning](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html) instruction. +To update Solr within an existing [[= product_name =]] project, first refer to the [Solr 9 upgrade planning](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-9.html) instructions. -Then, perform the following additional actions: +Then, follow the [instructions for setting up Solr 9 with [[= product_name =]]](/search/search_engines/solr_search_engine/install_solr.md#configure-and-start-solr) and merge them with your custom configuration. -1. Adjust the configuration files: +Changes include: - - rename the `schema.xml` configuration file to [`managed-schema.xml`](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-6.html#managed-schema-is-now-the-default) - - replace the contents of `custom-field-types.xml` [with the new content](https://github.com/ibexa/solr/blob/v4.6.22/src/lib/Resources/config/solr/custom-fields-types-solr9.xml), replacing the [removed `LatLonType` with the `LatLonPointSpatialField` field](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-7.html#deprecations-and-removed-features) +1. Configuration files changes -1. Configure the [Solr version in the project](install_solr.md#configure-solr-version). + - the `schema.xml` configuration file became [`managed-schema.xml`](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-6.html#managed-schema-is-now-the-default) + - the [removed `LatLonType` field is replaced by the `LatLonPointSpatialField` field](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-7.html#deprecations-and-removed-features) -1. Finish the update by [refreshing the search index](reindex_search.md). +1. New [Solr version parameter](install_solr.md#configure-solr-version) + +Once Solr 9 is fully configured, [refresh the search index](reindex_search.md). [[% include 'snippets/update/notify_support.md' %]] From d9baf95bb746f69be8567d28009be0612aa385d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Tue, 5 Aug 2025 20:50:28 +0200 Subject: [PATCH 15/15] Apply suggestions from code review Co-authored-by: julitafalcondusza <117284672+julitafalcondusza@users.noreply.github.com> --- docs/getting_started/requirements.md | 4 ++-- docs/search/search_engines/solr_search_engine/install_solr.md | 3 ++- docs/update_and_migration/from_4.6/update_from_4.6.md | 4 ++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/getting_started/requirements.md b/docs/getting_started/requirements.md index d20675dece..ed41f984ff 100644 --- a/docs/getting_started/requirements.md +++ b/docs/getting_started/requirements.md @@ -251,7 +251,7 @@ For production setups it's recommended that you use Varnish/Fastly, Redis, NFS/E - ImageMagick - GD - Optionally if you intend to edit [PNG, SVG, GIF or WEBP files in the Image Editor](images.md#image-optimization), or use it with image variations: + Optionally, if you intend to edit [PNG, SVG, GIF or WEBP files in the Image Editor](images.md#image-optimization), or use it with image variations: - JpegOptim - Optipng @@ -379,7 +379,7 @@ For production setups it's recommended that you use Varnish/Fastly, Redis, NFS/E === "[[= product_name =]] v5.0" [[= product_name =]] is developed to work with *any* web browser that supports modern standards, on *any* screen resolution suitable for web, running on *any* device. - However for the Editorial and Administration User Interfaces you need: a minimum of 1366-by-768 screen resolution, a desktop or tablet device, and a recommended/supported browser among the ones found below. + However, for the Editorial and Administration User Interfaces, you need: a minimum of 1366-by-768 screen resolution, a desktop or tablet device, and a recommended/supported browser among the ones found below. - Mozilla® Firefox® most recent stable version (recommended) - Google Chrome™ most recent stable version (recommended) diff --git a/docs/search/search_engines/solr_search_engine/install_solr.md b/docs/search/search_engines/solr_search_engine/install_solr.md index 00c97c1ea0..7fd54664a6 100644 --- a/docs/search/search_engines/solr_search_engine/install_solr.md +++ b/docs/search/search_engines/solr_search_engine/install_solr.md @@ -13,7 +13,8 @@ For configuring Solr in other ways, including examples, see [Solr Cores and `sol !!! note "Solr versions" - Supported Solr versions are Solr 7, 8 and 9. Using the most recent version of Solr is recommended. + Supported Solr versions are Solr 7, 8 and 9. + Using the most recent version of Solr is recommended. Download and extract Solr: diff --git a/docs/update_and_migration/from_4.6/update_from_4.6.md b/docs/update_and_migration/from_4.6/update_from_4.6.md index 74d9aded50..ff7860ba09 100644 --- a/docs/update_and_migration/from_4.6/update_from_4.6.md +++ b/docs/update_and_migration/from_4.6/update_from_4.6.md @@ -388,12 +388,12 @@ Then, follow the [instructions for setting up Solr 9 with [[= product_name =]]]( Changes include: -1. Configuration files changes +1. Configuration files - the `schema.xml` configuration file became [`managed-schema.xml`](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-6.html#managed-schema-is-now-the-default) - the [removed `LatLonType` field is replaced by the `LatLonPointSpatialField` field](https://solr.apache.org/guide/solr/latest/upgrade-notes/major-changes-in-solr-7.html#deprecations-and-removed-features) -1. New [Solr version parameter](install_solr.md#configure-solr-version) +2. New [Solr version parameter](install_solr.md#configure-solr-version) Once Solr 9 is fully configured, [refresh the search index](reindex_search.md).