AI OnAI Off
You could try creating a extension method something like this. (haven't tested this)
public static ITypeSearch<T> AllCategoriesMatch<T>(this ITypeSearch<T> search, IEnumerable<int> categories) where T : ICategorizable
{
foreach (var category in categories)
{
search = search.Filter(p => p.Category.Match(category));
}
return search;
}
and in your query
_client.Search<ArticlePage>().AllCategoriesMatch(selectedCategories)
Hi
I've to filter a page type ie Article pages conating a list of categories
My query is
var selectedCategories = new List
var result = _client.Search()
this code return articles conatain any of the categories in the list. But I want to return articles contain all the categories in list