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
-
- Log in to the Management Center and navigate to the Aurora eSite store.
- Select the Search Term Associations tab.
- Add some synonyms under the Synonyms(French)
section,
eg.
lait,laitier Santé, Paracétamol
- Add some replacements,
eg.
cheddar, fromage
- Save this configuration and wait for the NiFi queue to empty.
- Verify if created synonyms are working on the storefront.
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.
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.