Commerce Management Webstore Search, Include Rule

Update or delete a single search include rule for a web store.
Resource
1/commerce/management/webstores/webstoreId/search/results-rules/ruleId
Resource example
1https://yourInstance.salesforce.com/services/data/67.0/commerce/management/webstores/0ZExx000000005rGAA/search/results-rules/ruleId
Available version
66.0
HTTP methods
DELETE, PUT
Response body for DELETE
204: Successful Delete
Request body for PUT
Root XML tag
<searchResultsRule>
JSON example
1{
2  "searchResultsRules": [
3    {
4      "type": "BidirectionalSynonym",
5      "ruleDefinition": [
6        "shirt",
7        "blouse",
8        "top"
9      ],
10      "locales": [
11        "en_US"
12      ]
13    },
14    {
15      "type": "UnidirectionalSynonym",
16      "ruleDefinition": [
17        "jeans",
18        "denim pants"
19      ],
20      "locales": [
21        "en_US"
22      ]
23    },
24    {
25      "type": "BidirectionalSynonym",
26      "ruleDefinition": [
27        "dress",
28        "gown"
29      ],
30      "locales": [
31        "en_GB"
32      ]
33    }
34  ]
35}
Properties
Name Type Description Required or Optional Available Version
locales String Comma-separated list of locales that the include search rule applies to. Required 58.0
ruleDefinition String Comma-separated list of terms that the include search rule applies to. Valid number of unique strings is from 2 through 5. Required 58.0
type String Type of search rule. Value is:
  • BidirectionalSynonym—Use when terms are interchangeable and must return the same results both ways. For example, jacket ⇄ winter coat. Available from API version 66.0 and later.
  • Include—Use when a term in a query matches any term in a ruleDefinition, Commerce Search returns results for all terms in the list. Supported in API versions 58.0 to 66.0.

    We suggest using BidirectionalSynonym, which returns equivalent results for interchangeable terms in both directions, unlike Include.

    Note

  • UnidirectionalSynonym—Use when one term must expand results, but not necessarily the reverse. For example, jacket → hoodie. Available from API version 66.0 and later.
Required 58.0
Response body for PUT
Search Results Rule Output