Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
AI OnAI Off
Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more
Using the Search with GetContentResult, I have a convention for the Product:
public static List<string> SizesOfShoe(this ProductContent product) => ProductService.GetVariantsOrEmpty(product.ContentLink).Select(Size.ShoeSize).Select(x => x.Value).ToList();
That is applied as a convention:
Now, when I just use the TermsFacetFor(x => x.SizesOfShoe()) then I get proper results and TermsFacets has all the options with proper counts.
However, when I want to filter by the ShoeSize then I end up with no results.
The filter I'm creating is as following:
if (Criteria.ShoeSizes?.Any() ?? false) { var filter = client.BuildFilter<ClientProduct>(); foreach (var size in Criteria.ShoeSizes) filter = filter.Or(x => x.SizesOfShoe().MatchContained(y => y, size)); q = q.Filter(filter); }
ShoeSizes in Criteria is an IEnumerable<string>.
Am I doing something wrong? Case sensitivity is not an issue here since I'm dealing with numbers here (which are under strings).