HCL Commerce Version 9.1.12.0 or later

Troubleshooting: Search Term Association issues in the extended language set

Search Term Association (STA) updates may not take effect immediately in the Authoring environment due to cached data from the Query service. Time-based invalidation for the STA cache can correct this behavior. To enable this, use the Data Query Configuration API to set the STA cache time-to-live to a desired value.

Problem

Search Term Association updates may not take into effect immediately when previewing in the Authoring environment. This occurs because stale data could still be cached by the Query service runtime. The behavior can be corrected by enabling time-based invalidation for the STA cache in the Query service.

Steps to reproduce the problem
  1. Log in to the Management Center and navigate to the Aurora eSite store.
  2. Select the Search Term Associations tab.
  3. Add some synonyms under the Synonyms(French) section, eg.
        lait,laitier
        Santé, Paracétamol
    
  4. Add some replacements, eg.
         cheddar, fromage
  5. Save this configuration and wait for the NiFi queue to empty.
  6. Verify if created synonyms are working on the storefront.
Expected result
When you search for “Sante” or “Paracétamol,” both products would be expected to be displayed as they are now synonyms. Similarly, when “cheddar” is searched for, all cheese products should be displayed.
Actual Result
Synonyms are not applied.

Solution

Search Term Association changes do not go into effect immediately if the local cache is in use.

When the remote cache is enabled, cache invalidation will be triggered whenever an add, delete, or update operation is performed on STA from the Management Center. This happens because the default maximum time to live for the STA in Authoring defaults to -1. This setting means that cache invalidation is event-based instead of relying on a time-based cache invalidation. The same applies to the Live environment. Enabling time-based invalidation in the Authoring environment will allow invalidation of the STA cache used in the Query service.

To enable this behavior, perform the following steps using the Data Query Configuration API :
POST - /search/resources/api/v2/configuration?nodeName=component&envType=auth
{
    "extendedconfiguration": {
        "configgrouping": [
            {
                "name": "CrossTransactionCache",
                "property":
{               "name": "CrossTransactionCache/com.hcl.commerce.search.internal.expression.provider.SearchNLPSTAExpansionProviderHelper.getNodeData/authoringMaxTimeToLive",
                     "value": "5"                 }

            }
        ]
    }
}

The example above sets the STA cache time-to-live to five seconds.