ProductSearchCalculatedFacet reference
This article provides reference material about ProductSearchCalculatedFacet
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.
For the ProductSearchFacetDisplayType.RangeInput
display type min and max values can be specified only.
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 ProductSearchCalculatedFacetValue(Value: "RED", Text: "Red", Selected: true, Count: 1),
new ProductSearchCalculatedFacetValue(Value: "GREEN", Text: "Green", Selected: false, Count: 5),
new ProductSearchCalculatedFacetValue(Value: "BLACK", Text: "Black", Selected: false, Count: 7)
],
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 ProductSearchCalculatedFacetValue(Value: 5, Text: null, Selected: false, Count: 1),
new ProductSearchCalculatedFacetValue(Value: 50, Text: null, Selected: false, Count: 1)
]);