问题
We are using Apache Solr for powering our search & faceting for the e-commerce website.
We have a faceting filter that works fine except for the product that has the multiple combination for the attributes (variant options) that turns out to be different SKU, for example, a T-Shirt that has multiple colors & size options.
Currently, we have a facet that filters by Color as well as by Size, however, it does not consider the availability of product on combination level due to the fact that it is not indexed.
We want to have facet filter considers availability status of attribute combination, i.e.
Suppose we have T-Shirt in two colors, Red & Blue. In three sizes, S, M, L.
Red, S 1
Red, M 2
Red, L 2
Blue, S 0
Blue, M 5
Blue, L 1
When the large size goes out of stock for the Blue color, we want to disable the facet for that combination. i.e. Blue, L which has one qty available, goes out of stock, we want to disable L as facet option for Size when Blue color is selected.
Here is how it is being indexed, for the product.
Color:[Red,Blue]
Size:[S,M,L]
The Color & Size are the attribute value, which has the possible options indexed for that field separated by comma and then we are applying a split by transformation.
What could be the best way to index it that would allow us to support faceting on attribute combination level considering it's availability.
来源:https://stackoverflow.com/questions/58928299/solr-faceting-considering-the-availability-of-product-at-attribute-combination-l