I have a managed property called 'progamyear', which has values,for example, 2015, 2014, empty value etc. I am using getClientControl(this).sortOrRank in the display template. It works fine except for one thing: it always put the null value items at last no matter you perform 'ascending' or 'descending'. can anybody tell how to solve this issue? thanks.
1 Answer
You could either change the sorting applied like make the results sort based on your programyear property. You could also use Query rules to change the order in which results are displayed.
-
Could you please be more specific for your first approach? This is what I did, but I had above issue, Is this what you suggest? var availableSorts = ctx.DataProvider.get_availableSorts(); availableSorts.push({"name":"programyear_DEC","sorts":[{"p":"programyear","d":1}]});– XHMCommented Jan 21, 2016 at 16:24