independent facets for Cartesian product data
I am working on a products database that is built using a Cartesian product of multiple reference tables. This rendered all the products in the products table as just variants withe number closer to 700K records.
I am working on building a simple product model with all available variants as simple multi-valued field. This will reduce the products size from 700K to 4K which can easily fit with-in the limits of our Coveo cloud license.
Is it possible to create a multi-valued field in such a way that
grade1-size1-finish1; grade1-size1-finish2; grade2-size2-finish2
can result in individual facets for grade, size, finish and when grade1 is selected, size2 option is no longer available to user.
Or if user selects size2; grade1 and finish1 are removed for selection
Yes, that is exactly how facets are working out of the box with Coveo. As you select facet values, other facets refresh to display only values that can lead to refined search results. They would never let someone select a value that would lead to no results.
Let's assume you have 2 products
- Product A
- Variant 1: grade1-size1-finish1
- Variant 2: grade1-size1-finish2
- Product B
- Variant 1: grade2-size2-finish2
The goal is to index only the product items, not the variant items.
On the product items, you define 3 multi-value facet fields: variantsGrade, variantsSize, and variantsFinish.
When you index the product items, you loop over the variants, read and keep the variant attribute values. At the end, you can remove duplicate values and set the field values to a semicolon separated values string.
Then on your search page, you add 3 facets: one for each of those fields. Make sure to enable the "is multi-value" option on your facet components.