This API allows you to update a facet in Hawksearch dashboard and manage the facet configurations.
Example use case: Add a display rule for the Price facet so that it is only visible when Brand is ‘Columbia Sportswear’.
...
Code Block | ||
---|---|---|
| ||
{ "SyncGuid": "e96a399a-f25b-4311-bf26-68c958f5bfb8", "FacetId": 83284, "Name": "Price", "FacetType": "checkbox", "FieldType": "numeric", "MaxCount": 30, "MinHitCount": 1, "Field": "price", "Param": "", "DisplayType": "default", "ScrollHeight": 0, "ScrollThreshold": 0, "TruncateThreshold": 0, "SearchThreshold": 0, "SortOrder": 20932, "ExpandSelection": false, "IsCurrency": true, "IsNumeric": true, "IsSearch": false, "IsVisible": true, "UBound": null, "LBound": null, "Increment": "0", "NofVisible": 10, "Height": 0, "DisplayRuleXML": "<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<Rule xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" Operator=\"Any\" RuleType=\"Group\">\r\n <Rules>\r\n <Rule Operator=\"None\" RuleType=\"Eval\">\r\n <Rules />\r\n <Field>facet:brand</Field>\r\n <Condition>is</Condition>\r\n <Value>Columbia Sportswear</Value>\r\n </Rule>\r\n </Rules>\r\n <Field />\r\n <Condition />\r\n <Value />\r\n</Rule>", "SortBy": "Ascending", "ParentId": 0, "IsCollapsible": true, "IsCollapsedDefault": false, "SwatchData": null, "FacetRangeDisplayType": 0, "PreloadChildren": false, "Tooltip": "Price", "ShowSliderInputs": true, "ShowFacetImageCount": true, "FacetRanges": [ { "RangeId": 1, "Name": "$0 - $150.99\t", "LBound": "0", "UBound": "150.99", "SortOrder": 1, "AssetName": "", "AssetUrl": "" }, { "RangeId": 2, "Name": "$151 - $200.99", "LBound": "151", "UBound": "200.99", "SortOrder": 2, "AssetName": "", "AssetUrl": "" }, { "RangeId": 3, "Name": "$201 - $500", "LBound": "201", "UBound": "500", "SortOrder": 3, "AssetName": "", "AssetUrl": "" }, { "RangeId": 4, "Name": "$501 - $750", "LBound": "501", "UBound": "750", "SortOrder": 4, "AssetName": "", "AssetUrl": "" }, { "RangeId": 5, "Name": "$751 - $1000", "LBound": "751", "UBound": "1000", "SortOrder": 5, "AssetName": "", "AssetUrl": "" }, { "RangeId": 6, "Name": "$1000 - $2000", "LBound": "1000", "UBound": "2000", "SortOrder": 6, "AssetName": "", "AssetUrl": "" }, { "RangeId": 7, "Name": "$2000 - $3000", "LBound": "2000", "UBound": "3000", "SortOrder": 7, "AssetName": "", "AssetUrl": "" }, { "RangeId": 8, "Name": "$3000 and Up", "LBound": "3000", "UBound": "999999999", "SortOrder": 8, "AssetName": "", "AssetUrl": "" } ], "Tags": "", "CreateDate": "01-01-0001", "ModifyDate": "04-12-2021", "BoostBury": { "BoostValues": [], "BuryValues": [] }, "ListName": "Price", "NumericPrecision": 0, "CurrencySymbol": null } |
DisplayRuleXML Representation Example
If the condition set for the rules for selecting products is not linear and requires multiple clauses which cannot be accommodated by the attribute_name or the attribute_value structure, please specify the entire xml for the rule as shown below.
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?>
<Rule xmlns:xsd="https://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" RuleType="Group" Operator="All">
<Rules>
<Rule RuleType="Eval" Operator="None">
<Rules />
<Field>facet:brand</Field>
<Condition>is</Condition>
<Value>Columbia Sportswear</Value>
</Rule>
<Rule RuleType="Eval" Operator="None">
<Field>facet:subdepartment</Field>
<Condition>is</Condition>
<Value>Socks</Value>
</Rule>
<Rule RuleType="Eval" Operator="None">
<Rules />
<Field>keyword:Keyword</Field>
<Condition>contains</Condition>
<Value>sock</Value>
</Rule>
</Rules>
<Field />
<Condition />
<Value />
</Rule> |