Is there a way to have two searchClient result sets "stacked" or "concatenated" such that the first set preceeds ( in order ) the 2nd set?
For example we a result set of Dogs and one of Cats and we would like the Dogs (resultsDogs ) to appear infront of Cats (resultsCats) .
For example:
public ActionResult Index(SearchPage currentPage, string q = "", int p = 0) { var model = new SearchPageViewModel(currentPage) { SearchQuery = q, PageIndex = p }; if (q.HasValue()) { var resultsDogs = this.searchClient .UnifiedSearchFor(q, Language.English) .Track() .ApplyBestBets() .Skip(p * model.PageWeight) .Take(model.PageWeight) .OrderBy(x => x.SearchSection.HasValue()) .Filter(x => x.SearchSection.Match("Dogs")) .GetResult();
Is there a way to have two searchClient result sets "stacked" or "concatenated" such that the first set preceeds ( in order ) the 2nd set?
For example we a result set of Dogs and one of Cats and we would like the Dogs (resultsDogs ) to appear infront of Cats (resultsCats) .
For example:
public ActionResult Index(SearchPage currentPage, string q = "", int p = 0)
{
var model = new SearchPageViewModel(currentPage)
{
SearchQuery = q,
PageIndex = p
};
if (q.HasValue())
{
var resultsDogs = this.searchClient
.UnifiedSearchFor(q, Language.English)
.Track()
.ApplyBestBets()
.Skip(p * model.PageWeight)
.Take(model.PageWeight)
.OrderBy(x => x.SearchSection.HasValue())
.Filter(x => x.SearchSection.Match("Dogs"))
.GetResult();
var resultsCats = this.searchClient
.UnifiedSearchFor(q, Language.English)
.Track()
.ApplyBestBets()
.Skip(p * model.PageWeight)
.Take(model.PageWeight)
.OrderBy(x => x.SearchSection.HasValue())
.Filter(x => x.SearchSection.Match("Cats"))
.GetResult();
}
model.Results = [resultsDogs plus resultsCats]; // can this be accomplished?
return View(model);
}