Solr faceting considering the availability of product at attribute combination level for e-commerce merchandise like Garment

风流意气都作罢 提交于 2020-01-05 03:48:10

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!