createFacetList

post

/gsadmin/v1/{appName}/content/facets/{facetListName}

Create a facet list

Request

Supported Media Types
Path Parameters
Body ()
The facet list that defines an explicit order of facets at a given location.
Root Schema : FacetList
Type: object
Represents a list of facet value records.
Show Source
Example:
{
    "items":[
        {
            "key":"Acme",
            "displayOrder":"1",
            "x_imageUrl":"acme.png",
            "x_description":"Acme is a great brand"
        },
        {
            "key":"Value Brand",
            "displayOrder":"2",
            "x_imageUrl":"valueBrand.png",
            "x_description":"Value Brand is a great brand"
        }
    ]
}
Nested Schema : items
Type: array
Show Source
  • FacetValue
    Represents a facet value record from a facet record collection. This can be used to specify displayOrder and custom properties for a facet value. Custom properties must contain an underscore character. For example 'x_imageUrl' might be created to associate an image with a facet value.
Nested Schema : FacetValue
Type: object
Represents a facet value record from a facet record collection. This can be used to specify displayOrder and custom properties for a facet value. Custom properties must contain an underscore character. For example 'x_imageUrl' might be created to associate an image with a facet value.
Show Source
  • Optionally specifies a display name. If no 'displayName' is configured, the 'key' is used. This is useful if you want to match data records on one value, but display another.
    Example: Acme Brand
  • Specifies the order display when the given facets is sorted by 'displayOrder' within 'displayConfig' under /attributes
    Example: 1
  • This is used when matching data records during indexing.
    Example: Acme
  • If this attribute has a context=locale under /attributes, then a locale code must be specified to match data records. To view the list of configured locale codes, you can GET /gsadmin/v1/cloud/searchIndexConfig and examine the union of 'defaultLocale' plus 'locales'.
    Example: en
  • Specifies the lower bound for a range facet value. The facet configuration /gsadmin/v1/cloud/attributes/system/{attribute name} need to specify a 'rangeComparisonType' to configure a facet as a range facet. The values that you POST to /gsdata are wrapped in quotes, but the actual value inside must match the 'rangeComparisonType'. The configured lower bound is inclusive.
    Example: 4.500
  • If this attribute has a context=priceGroup under /attributes, then a priceGroup name must be specified to match data records. To view the list of currently configured priceGroup values, you can GET /gsadmin/v1/cloud/attributeContexts/priceGroup
    Example: defaultPriceGroup
  • Allowed Values: [ "UPSERT", "DELETE" ]
    Instructs the system what to do with this record. If not specified defaults to upsert. Typically, you would only ever specify DELETE to delete an existing facet value record.
    Example:
  • Specifies the upper bound for a range facet value. The facet configuration /gsadmin/v1/cloud/attributes/system/{attribute name} need to specify a 'rangeComparisonType' to configure a facet as a range facet. The values that you POST to /gsdata are wrapped in quotes, but the actual value inside must match the 'rangeComparisonType'. The configured upper bound is not inclusive.
    Example: 5.00
Security
Back to Top

Response

Supported Media Types

201 Response

Indicates that the new facet list definition was successfully created.
Body ()
Root Schema : Response
Type: object
Show Source
Back to Top

Examples

The following example shows how to create a facet list:

Request Body Example

The following shows how to create a facet list called Facet1.

{
     "ecr:type": "content-item",
     "workflowState": "ACTIVE",
     "contentItem": {
        "@type": "GuidedNavigation",
        "showAll": false,
        "navigation":
        [
   {
        "@type": "RefinementMenu","@name": "Category",
        "dimensionName": "product.category"
   },
   {
        "@type": "RefinementMenu","@name": "Price Range",
        "dimensionName": "product.priceRange"
   },
   {
        "@type": "RefinementMenu","@name": "Brand",
        "dimensionName": "product.brandName"
   }
   ]
    }
    "triggers": [{
        "exactLocation": true,
        "dvalIDs": ["101022"]
    }]
}
Back to Top