Posted on 15/02/2016 23:09:39
If your product list only shows main products, it cannot show only options that are in stock (because it is the stock level from the main product that are used as criteria).
If your product list shows all variants, you can filter out the options that are not in stock (because it is the stock level from the variant product that are used as criteria).
Both examples are only valid for products in stock at the time of indexing. If a variant goes out of stock and you do not re-index, you would still have a problem with the facets (Products not in stock are removed by the rendering).
If you want to show only main products in the product list, and only variant options for variants in stock, you need 2 searches - one for the main search, and one just to return you the facet options for the variants. Then in the product list, instead of having facets on your main search, you load the facet options from the secondary search using JSON/partial HTML loading.
BR Nicolai