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

How to use Find to search both cms pages and products in one request

$
0
0

Hi, 

I would like to search both cms pages e.g. standpages and commerce products, categories in one request 

I tried to use the following solution but it seems not working correctly and I have problem with the value of totalmatching. 

...

multiSearch = searchClient.Search<ContentData>().For(query).FilterForVisitor(currentLanguage).Skip(skip).Take(itemsPerPage).Track().GetContentResult();

foreach (var item in multiSearch)
{
if (item is Article)
{var article = ((Article)item);

....}

else if (item is Category)
{
var category = ((Category)item);

...}

else if (item is SitePageData)
{ var pageData = ((SitePageData)item);

...}

Any suggestions guys?

Thanks, 

ChiChing


Viewing all articles
Browse latest Browse all 9076

Trending Articles