Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Finding products using properties on Products and Variants.

$
0
0

Hello!

I am wanting to search for products and variants in Episerver Find. I have inherited from ProductContent and VariationContent and created an index. I am able to pull back products using code like this:

var productSearch = SearchClient.Instance.Search<FoodserviceProduct>()
.FilterFacet("BrandFacet", x => x.Brand.Match("Acme"))

This returns results successfully. However, in addition to being able to search by properties on my ProductContent, I also need to be able to search on properties that are apart of the product variants (VariationContent).

Can someone please help me understand how to do that? In other words, if my Product looks like this:

*Product Name
*Brand

and that product has several variants underneath it with properties like this:

*Size
*Color

How do I construct my query so that I can search based on Brand and Color (for instance)?


Viewing all articles
Browse latest Browse all 9076

Trending Articles