Configure facets and filters
Describes the various parts of the configuration elements related to facets and filters in Optimizely Commerce Connect.
The configuration file is located in the Configs folder and is called Mediachase.Search.Filters.config. The file contains the following elements:
Filteris the facet group.Filter[field]is the name of the field or meta-field being filtered.Filter/Descriptioncontains the localized text for a facet group. This determines what is displayed at the top of the side menu.Filter/Valuescontains all facets for that facet group.
Each facet group should have one type of facet. The following list describes the facet types.
SimpleValue– A string value.[key]– Attribute is not used but should be lowercase.[value]– The lookup key value; must be lowercase.Descriptions[defaultLocale]– Specifies which localized description is used if no localization is specified.Description[locale]– Specifies the culture code of the filter description.Description– The value to display in theSideMenu, based on the locale.
PriceRangeValue– Price ranges.[key]– The lookup key value; must be lowercase. The options are under-number, number-number, and over-number[currency]– A three-character currency code that corresponds to the code selected in the tiered pricing collection of a SKU.[lowerbound]– The numeric lower end of the range.[upperbound]– The numeric upper end of the range.[lowerboundincluded]– Must betrueorfalse. Indicates whether the lower-bound value is included in the filtered range. For example, iflowerboundincludedis set totruefor a $200–$300 filter range, items that are exactly $200 are included in the results.[upperboundincluded]– Must betrueorfalse. Indicates whether theupperboundvalue is included in the filtered range.
RangeValue– Numeric ranges; values must be 0–10.- This type matches a range of numeric values.
- This filter data type only supports values less than 10.
- If a numeric type such as float or decimal defines the meta-class, set
numeric="true". - You can use a string meta-field type; the
numericattribute is not relevant. - These values, including numeric values, are passed as string values to Lucene, which treats them as
Doublevalues. - Attributes are a subset of the
PriceRangeValuefilter data type.
The following example shows the facets in the Optimizely Commerce Connect sample site:
<SearchConfig version="1.0">
<SearchFilters>
<Filter field="brand">
<Descriptions defaultLocale="en">
<Description locale="en">Brand</Description>
<Description locale="sv">Märke</Description>
</Descriptions>
<Values>
<SimpleValue key="Brand 0" value="Brand 0">
<Descriptions defaultLocale="en">
<Description locale="en">Brand 0</Description>
<Description locale="sv">Märke 0</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="Brand 1" value="Brand 1">
<Descriptions defaultLocale="en">
<Description locale="en">Brand 1</Description>
<Description locale="sv">Märke 1</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="Brand 2" value="Brand 2">
<Descriptions defaultLocale="en">
<Description locale="en">Brand 2</Description>
<Description locale="sv">Märke 2</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="Brand 3" value="Brand 3">
<Descriptions defaultLocale="en">
<Description locale="en">Brand 3</Description>
<Description locale="sv">Märke 3</Description>
</Descriptions>
</SimpleValue>
</Values>
</Filter>
<Filter field="color">
<Descriptions defaultLocale="en">
<Description locale="en">Color</Description>
<Description locale="sv">Färg</Description>
</Descriptions>
<Values>
<SimpleValue key="black" value="black">
<Descriptions defaultLocale="en">
<Description locale="en">Black</Description>
<Description locale="sv">Svart</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="white" value="white">
<Descriptions defaultLocale="en">
<Description locale="en">White</Description>
<Description locale="sv">Vit</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="red" value="red">
<Descriptions defaultLocale="en">
<Description locale="en">Red</Description>
<Description locale="sv">Röd</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="blue" value="blue">
<Descriptions defaultLocale="en">
<Description locale="en">Blue</Description>
<Description locale="sv">Blå</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="multi" value="multi">
<Descriptions defaultLocale="en">
<Description locale="en">Multi</Description>
<Description locale="sv">Multi</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="brown" value="brown">
<Descriptions defaultLocale="en">
<Description locale="en">Brown</Description>
<Description locale="sv">Brun</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="navy" value="navy">
<Descriptions defaultLocale="en">
<Description locale="en">Navy</Description>
<Description locale="sv">Marin</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="yellow" value="yellow">
<Descriptions defaultLocale="en">
<Description locale="en">Yellow</Description>
<Description locale="sv">Gul</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="green" value="green">
<Descriptions defaultLocale="en">
<Description locale="en">Green</Description>
<Description locale="sv">Grön</Description>
</Descriptions>
</SimpleValue>
</Values>
</Filter>
<Filter field="size">
<Descriptions defaultLocale="en">
<Description locale="en">Size</Description>
<Description locale="sv">Storlek</Description>
</Descriptions>
<Values>
<SimpleValue key="s" value="s">
<Descriptions defaultLocale="en">
<Description locale="en">S</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="m" value="m">
<Descriptions defaultLocale="en">
<Description locale="en">M</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="l" value="l">
<Descriptions defaultLocale="en">
<Description locale="en">L</Description>
</Descriptions>
</SimpleValue>
</Values>
</Filter>
<Filter field="top_category_name">
<Descriptions defaultLocale="en">
<Description locale="en">Top category</Description>
<Description locale="sv">Toppkategori</Description>
</Descriptions>
<Values>
<SimpleValue key="Mens" value="Mens">
<Descriptions defaultLocale="en">
<Description locale="en">Mens</Description>
<Description locale="sv">Män</Description>
</Descriptions>
</SimpleValue>
<SimpleValue key="Womens" value="Womens">
<Descriptions defaultLocale="en">
<Description locale="en">Womens</Description>
<Description locale="sv">Kvinnor</Description>
</Descriptions>
</SimpleValue>
</Values>
</Filter>
</SearchFilters>
</SearchConfig>Related blog post: Configurable Optimizely Find Facets.
Updated 20 days ago
