Broadleaf Microservices
  • v1.0.0-latest-prod

Search Services Release Notes for 2.2.1-GA

Tip
The 2.x versions are Spring Boot 3 compatible.

Requirements

  • JDK 17 is required for Broadleaf release trains 2.0.0-GA, and beyond.

  • This version requires CatalogServices 2.2.1+ documented in the 2.2.1 Catalog Release Notes

Important
After upgrading to this version, a full reindex is required for the changes to take effect.

Important Updates

New Features & Notable Changes

Added search field on required product options info

This indexes the requiredOptionInfo field on the ConsolidatedProduct object. This corresponds to changes in Catalog Service 2.1.5 introducing RequiredOptionInfo to the ConsolidatedProduct object.

Example Product document with changes
{
      "type_s":"PRODUCT",
      "id":"01HZSSTPMDM70Q8FTZ6TNQFA54!CATALOG=TELCO_MASTER_CATALOG,SANDBOX=null,TRACKING_LEVEL=100000",
      "contextId_s":"01HZSSTPMDM70Q8FTZ6TNQFA54",
      "name_s":"Pay as You Go Bundle",
      "name_t":"Pay as You Go Bundle",
      "name_tta":"Pay as You Go Bundle",
      "name_ttas":["Pay as You Go Bundle"],
      "name_lower":"Pay as You Go Bundle",
      "uri_s":"/bundles/pay-as-you-go",
      "currency_currency":"EUR",
      "price_money":0.0,
      "businessType_s":"PHONE_FIRST_JOURNEY",
      "businessType_t":"PHONE_FIRST_JOURNEY",
      "name_s_fr":"Pay as You Go Bundle",
      "name_t_fr":"Pay as You Go Bundle",
      "name_tta_fr":"Pay as You Go Bundle",
      "name_ttas_fr":["Pay as You Go Bundle"],
      "name_lower_fr":"Pay as You Go Bundle",
      "name_s_es":"Pay as You Go Bundle",
      "name_t_es":"Pay as You Go Bundle",
      "name_tta_es":"Pay as You Go Bundle",
      "name_ttas_es":["Pay as You Go Bundle"],
      "name_lower_es":"Pay as You Go Bundle",
      "activeStartDate_dt":"2025-05-06T14:25:37.265Z",
      "activeEndDate_dt":"9999-01-01T01:00:00Z",
      "online_b":true,
      "searchable_b":true,
      "bestPrice_money":79.0,
      // NEW //
      "productType_s":"MERCHANDISING_PRODUCT",
      // FIXED //
      "productPricingPredicate_s":"{\"pricingKey\":\"01HZST1AY10PM1V7STWD8FJQP0\",\"productSku\":null,\"price\":{\"amount\":0.00,\"currency\":\"EUR\"},\"salePrice\":null,\"cost\":null,\"defaultSku\":null,\"lowestPricedSku\":null}",
      // NEW //
      "requiredOptionInfo_s":"[{\"pricingKey\":\"018FF39E-29DC-F683-F108-5744BB057A4C\",\"targetType\":\"CATEGORY\",\"minimumQuantity\":1,\"defaultChoiceUnderlyingSku\":\"223558\",\"defaultChoiceUnderlyingPricingKey\":\"01J361ESX5YPMF4DCZ8ENR0BKY\",\"defaultChoicePrice\":{\"amount\":79.00,\"currency\":\"EUR\"}},{\"pricingKey\":\"018FF3A0-1366-A366-B8F5-49CB5BB47FEF\",\"targetType\":\"CATEGORY\",\"minimumQuantity\":1,\"defaultChoicePrice\":{\"amount\":0.00,\"currency\":\"USD\"}}]",
      "catalog_s":"TELCO_MASTER_CATALOG",
      "trackingLevel_i":100000,
      "tenant_s":"Telco",
      "_version_":1831387928950996993
}

To facilitate indexing this data and returning on both search results and type ahead results, the following components were introduced:

  • RequiredOptionInfoSolrDocumentBuilderContributor - This contributor adds the requiredOptionInfos_s field to the Solr document.

  • RequiredOptionInfoSolrQueryContributor - This contributor adds the requiredOptionInfos_s field to the Solr query.

  • ProductRequiredOptionInfoResponseDecorator - This decorator adds the requiredOptionInfos field to the Product response DTO.

  • ProductTypeDocumentBuilderContributor - This contributor adds the productType_s field to the Product Type Solr document.

  • ProductTypeQueryContributor - This contributor adds the productType_s field to the Product Type Solr query.

  • ProductTypeResponseDecorator - This decorator adds the requiredOptionInfos field to the Product Type response DTO.

  • ProductTypeAheadSuggestionFieldsPostProcessor - This post processor adds the productType, requiredOptionInfos, and productPricingPredicate fields to typeahead responses.

    • This component will also set the id so that the TypeAheadSuggestionFieldsPostProcessor can merge related suggestions together.

    • This is a separate component from TypeAheadSuggestionFieldsPostProcessor since it adds implicit fields specific to Products, which are Catalog entities whereas TypeAheadSuggestionFieldsPostProcessor is used for all entities.

Synonym Management

  • Added support for synonyms. Much of this code was already in place (API interactions, initial file loading), however it was not in use, not publicly documented, and no admin views existed to manage synonyms. As a result backwards compatibility has not been accounted for.

    • Updated synonym loading to support spaces in synonyms

    • Added managed language concept as properties. This requires a managed language to be defined in Solr. This is not equivalent to a locale but can use similar naming.

    • Updated synonym service and APIs to support managed language feature.

    • Add metadata for managing synonyms for products.

Bug Fixes

Solr Document Additions and Product Query changes

Note
This change is important to fix issues with the Solr search narrowing.
  • Multiple Solr fields have been added to the Product Solr document to help with narrowing to the correct users, sandboxes, and catalogs. These fields are introduced through the Solr Contributors CatalogTrackableSolrDocumentBuilderContributor and SandboxTrackableSolrDocumentBuilderContributor.

    • sandboxAwareCatalogOverrides_ss

      • This field contains the IDs of Catalog Overrides for a Product with additional sandbox information paired with the ID. For example, a Product will have a Catalog Override when a parent Catalog level product is updated in a child Catalog.

    • creatingApplicationId_s

      • This field contains an Application ID in which a Product was created. If the Product is made in a Tenant context, then this value should be null.

      • This value is designed to be the same as the value in Tracking.creatingApplicationId.

    • catalogAwareSandboxOverrides_ss

      • This field contains the IDs of Sandbox Overrides for a Product with additional catalog information paired with the ID. For example, a Product will have a Sandbox Override when a promoted Product update is saved to a sandbox but not promoted.

    • catalogOmissions_ss has also been added to the document in order to have a separate field for Catalog Omissions. Previously omissions were only added as part of the catalogOverrides_ss and the addition of a separate field enables more granular filtering.

  • CatalogTrackableSolrQueryContributor and SandboxTrackableSolrQueryContributor have been updated to filter against the new fields above.

    • The changes in the contributors fix narrowing in the search results, adding a more comprehensive set of filters. This prevents items from incorrectly being returned or missed in the search due to insufficient narrowing logic.

    • For example, given a set of Sandbox discriminated records, the extra logic utilizing the creatingApplicationId field will narrow down the returned Product based on the appropriate creating application.

    • Marketplace applications have also been updated to utilize the new filters.

  • The signatures of the methods listed below were updated as a part of this change, so clients who have overridden or are directly referencing them will need to update their references to match the new signatures.

    • CatalogTrackableSolrQueryContributor#addMarketplaceFilter

    • CatalogTrackableSolrQueryContributor#filterOverriddenCatalogs

  • Refactored SandboxTrackableDocumentBuilderPreProcessor to update sandboxOverrides only in cases where the field was not already found within the Indexable.

  • Updated the Javadocs for the added and updated narrowing fields to more accurately and clearly describe some of the existing and new functionality.

Fixed possible out-of-bounds error or mis-serialization for Field Definitions where combined paths are enabled

Fixed possible out-of-bounds errors or mis-serialization for Field Definitions where combined paths are enabled but the value on the Indexable at the path is null. Previously if a user had a combined path Field Definition and one of the property paths' values was null, the value was omitted. If the user were to then try to parse the field value in a search response, then they would have no indication that one of the values is missing and could get index out of bounds errors or map values into the wrong DTO structure.

Example Scenario
Example FieldDefinition
{
    "multiValued": true,
    "combined": true,
    "multiValuedCombinedPropertyRootPath": "categories.*",
    "propertyPaths": ["id", "nullable.value", "name"],
    "delimiter": "||"
}
Example Indexable
{
    "categories": [
        {
            "id": 1,
            "nullable": {
                "value": 1
            },
            "name": "Category 1"
        },
        {
            "id": 2,
            "nullable": {
                "value": null
            },
            "name": "Category 2"
        }
    ]
}
Search Response Expected to Contain the following field values
[
  "category1||1||Category 1",
  "category2||||Category 2"
]
Actual field values without fix
[
  "category1||1||Category 1",
  "category2||Category 2"
]

Using that example, it can be seen that if the user was trying to deserialize the response structure into a DTO, it would fail on the second result since it is missing the expected number of fields.

Miscellaneous

  • Fixed Product bestPrice not accounting for priceWithDependentItems for Merchandising Products.

  • Fixed productType not being indexed and therefore not being returned on the Product in search results.

  • Fixed an issue where AbstractSolrQueryContributor beans could be initialized in an unexpected order by Spring when no explicit order was defined. The fix assigns specific ordering to ensure predictable execution for beans that depend on others, specifically DefaultSolrFacetContributor and DefaultSolrFilterContributor.

  • Improved resilience in the Indexer flow by adding timeouts and retries to service calls to Catalog(DefaultCatalogService#readBatchOfProducts) and Inventory(DefautlInventoryAvailabilityService#findConsolidatedInventoryAvailability), with proper backoff strategies. See properties broadleaf.indexer.inventory.service and broadleaf.indexer.catalog.service in Collections properties

  • Fixed an issue where searching for Products via a search term (i.e. "Sauce") in the Admin has the results sorted by ID instead of relevancy