Reputation: 387
I'm using EPiServer 11 version with EPiServer.Find. I have a requirement to fetch all pages for landingPage type and standardPage types in one query.
Can you suggest if it is possible.
Upvotes: 1
Views: 1298
Reputation: 387
Thanks for suggestions. I managed to solve this as below.
var results = SearchClient.Instance.Search<PageData().FilterForVisitor().FilterOnCurrentSite()
.Filter(x => x.MatchType(typeof(LandingPage)) | x.MatchType(typeof(StandardPage)))
.GetContentResult();
Hope, it helps someone.
Upvotes: 1
Reputation: 221
The documentation uses searching for pages of specific type as an example so I would recommend reading that.
In your case you would just have to add both page types into the query
Upvotes: 0