Hello, I have index of products, each product has variants. I am trying to filter by attributes of variants. Structure of product looks like:
{
name: 'T-Shirt',
variants: [
{ color: 'red', size: 'M' },
{ color: 'blue', size: 'L'}
]
}
Now, I am trying to filter products with color - red & size - L
- I am getting T-Shirt
because it has one variant with color red
and another variant with size L
. Unfortunately, I expect to get only products which has one variant that is both red and L.
I am sending a query with parameters like:
// ...
facetFilters: ["variants.color:red", "variants.size:L"],
facets: ["variants.color", "variants.size"]
I see that facets
are also computed badly - in the same manner as results. Do you have an idea how to force values to be present in one object inside nested array?