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

Multiple filter based on different PageTypes in Find Query

$
0
0

Hi,

I am trying to create episerver Find query that requires different filters on different PageType

Here is the scenario

All PageTypes are driven from Abscrtact Class BasePage

so in Episerver Find query its easy to create a filter for all the PageTypes

var query= SearchClient.Instance.Search<BasePage>();

query= query.For("Search Tex"t).InFields(f => f.MetaTitle, f => f.MetaDescription);

query= query.Filter(x => x.ExcludeFromSearch.Match(false));

var batch = query.GetContentResult();

now for the PageType ArticlePageType I need to apply special multiple filters that are only relevant to that ArticlePageType. So how can I achieve this in the same query? the output should be IContentResult<BasePage> 


Viewing all articles
Browse latest Browse all 9076

Trending Articles