HCL Commerce Version 9.1.9.0 or later

Synonym-related configurations

You can optimize your use of synonyms and keywords by carefully distinguishing between the two and by adjusting the values of certain variables that control the Query system response to synonyms.

Variables that influence synonym processing

You can adjust the behavior of synonym expansion and processing using two variables.
Note: Do not use special characters, such as "' , . = * # @ & % ? ; $ in the synonym definition. You may use their escaped versions, such as \*,~,\?,'',"",.*\\.*,.*/.*,.*\|.*. For more information, see Expanding synonyms and Search Term Associations at query time.
SynonymExpansionThreshold
Used to control the synonym expansion threshold. You can update this variable through the configuration API endpoint for the component node. The default limit is set to 20. For each search term matching to a synonym, only the first 20 terms from a given synonym entry will be used for synonym expansion.
MaximumLengthOfSearchPhrase
Sets the limit on the maximum number of characters processed the search phrase (searchTerm) request parameter. The default limit is set to 100 characters. This means only the first 100 characters of the incoming search phrase will be processed.
following is an example of how to configure the above two settings:
POST/PATCH http://<dataQueryHost>:<dataQueryPort>/search/resources/api/v2/configuration?nodeName=component&envType=auth
{
    "extendedconfiguration": {
        "configgrouping": [
            {
                "name": "SearchConfiguration",
                "property": [
                    {
                        "name": "SynonymExpansionThreshold",
                        "value": "30"
                    },
                    {
                        "name": "MaximumLengthOfSearchPhrase",
                        "value": "120"
                    }
                ]
            }
        ]
    }
}

If a local cache is used, STA modifications do not immediately occur. When remote caching is enabled, add, remove, or update actions are done on STA from the Management Center, then cache invalidation will be triggered. It is because cache invalidation relies on events rather than a time-based cache invalidation since the maximum time to live for the STA in Authoring is configured to -1. The Live environment follows the same rules. With the Data Query Configuration API, perform the following actions to enable time-based invalidation in Authoring for invalidating the STA cache used in Query Service.

The following example uses a 5 second STA cache time-to-live set.
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"                 }
            }
        ]
    }
}