ProductSearchFacet reference
This article provides reference material about ProductSearchFacet
record.
Properties
Name
The facet name.
Can be the same as FieldName
in case there is no specific name.
The facet name is used in ProductSearchFacetFilter.
FieldName
The field name.
Title
The facet title.
DisplayType
The facet display type.
Values
The facet values.
MultiSelect
The value indicating whether multiple values selection is enabled for the facet.
Collapsed
The value indicating whether the facet should be collapsed by default.
Collapsible
The value indicating whether the facet is collapsible.
TopValuesCount
The count of facet values shown in the top values.
Texts
The facet custom texts.
Example:
var texts = new ProductSearchFacetTexts(
ExpandText: "Show more colors",
CollapseText: "Show less",
SearchPlaceholderText: "Search in colors",
SearchNoResultsText: "No colors found");
var colorFacet = new ProductSearchFacet(
Name: "Color",
FieldName: "Color",
Title: null,
DisplayType: null,
Values:
[
new ProductSearchFacetValue(Value: "RED", Text: "Red"),
new ProductSearchFacetValue(Value: "GREEN", Text: "Green")
],
MultiSelect: true,
Collapsed: true,
Collapsible: true,
TopValuesCount: 10,
Texts: texts);
var priceFacet = new ProductSearchFacet(
Name: "Price",
FieldName: "Pirce_Excl_Vat",
Title: null,
DisplayType: ProductSearchFacetDisplayType.RangeInput,
Values:
[
new ProductSearchFacetValue(Value: 5, Text: null),
new ProductSearchFacetValue(Value: 10, Text: null)
]);