London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
AI OnAI Off
London Dev Meetup Rescheduled! Due to unavoidable reasons, the event has been moved to 21st May. Speakers remain the same—any changes will be communicated. Seats are limited—register here to secure your spot!
Hi,
I would like to sort results by published date in each facet returned by the results.
//Applying ReadAccess_Filter for the query
var query = SearchClient.Instance.Search<BasePage>(Language.Swedish).ForWithWildcards(Query)
.InField(x => x.PageName)
.AndInField(x => x.MainBody)
.BoostSummaryComments(10)
.AndInField(x => x.SearchText)
.InAllField()
.Track()
.Filter(ReadAccess_Filter)
.TermsFacetFor(x => x.SearchHitType, x => x.AllTerms=true);
Results = query.Select(x => new Hit {
Title = x.PageName,
Url = x.LinkURL,
Text = GetSnippet(
x.SearchText.AsHighlighted(GetHighlightSpec()),
x.SearchText.AsCropped(200)),
pubDate = x.StartPublish.GetTodayOrTomorrowOrTimeAndDate(),
Type = x.SearchHitType
}).GetResult();
rpFilter.DataSource = Results.TermsFacetFor<BasePage>(x => x.SearchHitType);
Any help is appreciated !