1

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
  • Are you not wanting the nulls to show? Where do you want them? Maybe you could separate them into a different result set if sorting them with other records is a problem.
    – jpollar
    Commented Jan 16, 2016 at 0:18

1 Answer 1

0

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.

1
  • 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}]});
    – XHM
    Commented Jan 21, 2016 at 16:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.