AI OnAI Off
I would try to have the OrderBy-clause as late as possible. You could for instance remove it from the query =..., and then do something like this:
var result = query.Select(x => new SearchHit
{
PageTitle = x.PageName,
Id = x.PageLink.ID,
Url = x.LinkURL,
StartPublish = x.StartPublish
})
.Track()
.Take(Count)
.OrderByDescending(x => x.StartPublish)
.GetResult();
Kishore, your query looks correct to me. Perhaps you could give a bit more details on what is wrong? How are your results looking? How are they sorted?
Where you put the OrderBy-clause should not matter as it will only add the sort option to the query, which is executed when GetResult() is called.
Hi.
I want to sort the results.So, I tried the following code, but unfortunately this is not working for me.
Can you please check and give some suggestions to update this code :
Thanks.
Kishore