Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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
languagejson
PUT /api/v9/facet/83284 HTTP/1.1
Host: manage.hawksearch.com
X-HawkSearch-ApiKey: USE_YOUR_API_KEY
Content-Type: application/json
Cache-Control: no-cache

   {
        "SyncGuid": "e96a399a-f25b-4311-bf26-68c958f5bfl8",
        "FacetId": 83284,
        "Name": "Price test",
        "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": 72624,
                "Name": "$0 - $150.99\t",
                "LBound": "0",
                "UBound": "150.99",
                "SortOrder": 1,
                "AssetName": "",
                "AssetUrl": ""
            },
            {
                "RangeId": 72625,
                "Name": "$151 - $200.99",
                "LBound": "151",
                "UBound": "200.99",
                "SortOrder": 2,
                "AssetName": "",
                "AssetUrl": ""
            },
            {
                "RangeId": 72626,
                "Name": "$201 - $500",
                "LBound": "201",
                "UBound": "500",
                "SortOrder": 3,
                "AssetName": "",
                "AssetUrl": ""
            },
            {
                "RangeId": 72627,
                "Name": "$501 - $750",
                "LBound": "501",
                "UBound": "750",
                "SortOrder": 4,
                "AssetName": "",
                "AssetUrl": ""
            },
            {
                "RangeId": 72628,
                "Name": "$751 - $1000",
                "LBound": "751",
                "UBound": "1000",
                "SortOrder": 5,
                "AssetName": "",
                "AssetUrl": ""
            },
            {
                "RangeId": 72629,
                "Name": "$1000 - $2000",
                "LBound": "1000",
                "UBound": "2000",
                "SortOrder": 6,
                "AssetName": "",
                "AssetUrl": ""
            },
            {
                "RangeId": 72630,
                "Name": "$2000 - $3000",
                "LBound": "2000",
                "UBound": "3000",
                "SortOrder": 7,
                "AssetName": "",
                "AssetUrl": ""
            },
            {
                "RangeId": 72631,
                "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 test ",
        "NumericPrecision": 0,
        "CurrencySymbol": null
    }

...

Code Block
languagejson
{
    "SyncGuid": "e96a399a-f25b-4311-bf26-68c958f5bfb8",
    "FacetId": 83284,
    "Name": "Price test",
    "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 test ",
    "NumericPrecision": 0,
    "CurrencySymbol": null
}

...