Multiple searches in one request

Vote:
 

I want to use Episerver Find MultiSearch to limit nr of requests to Find, as specified here

How can I dynamically add Searches, typically inside a foreach statement?

The code below works, but I can see through Fiddler that nr of request matches 'mainCategories' count.

if (mainCategories.Any())
 {
     var multiSearchQuery = SearchClient.Instance.MultiSearch<EntryContentBase>();
     foreach (var mainCategory in mainCategories)
     {
        var mainCategoryName = mainCategory.Term;
        multiSearchQuery.Searches.Add(
                multiSearchQuery.Client.Search<EntryContentBase>()
                     .CommonProductFilter(currentStore)
                     .AddPromotionPrefixAndStoreFilter(prefix, currentStore)
                     .Filter(p => p.MainCategory().Match(mainCategoryName))
                     .Take(count));
     }
                
     var contentResults = multiSearchQuery.GetContentResult();
     
}
#215972
Edited, Jan 21, 2020 9:51
Vote:
 

Same result if I do this:

if (mainCategories.Any())
 {
     var multiSearchQuery = SearchClient.Instance.MultiSearch<EntryContentBase>();
     foreach (var mainCategory in mainCategories)
     {
        var mainCategoryName = mainCategory.Term;
        multiSearchQuery.Search<EntryContentBase>(
                m => m.CommonProductFilter(currentStore)
                     .AddPromotionPrefixAndStoreFilter(prefix, currentStore)
                     .Filter(p => p.MainCategory().Match(mainCategoryName))
                     .Take(count));
     }
                
     var contentResults = multiSearchQuery.GetContentResult();
     
}
#215973
Jan 21, 2020 9:53
Vote:
 

Update: this has been handed over to the support team - seems like a bug.

#216368
Feb 05, 2020 7:24
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.