Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

In SP 2013 with refiners you have the ability to Sort By Name, Count, Number. Each of my lists have a Title and Order column. I want the items in my refinement panel on the search page to be sorted by the "Order" column in the list and display the title. Any ideas would be great if this is possible.

share|improve this question

2 Answers 2

Have you set the "Sortable" attribute for your Order Managed Property and then performed a full crawl?

share|improve this answer
    
Yes, the OOTB one I am using RefinableString01. The refinement panel is using that. But my problem is I need it to be sorted by column A but show column B in the refinement panel. I cant see how that is possible. –  NYTom Sep 10 '13 at 20:51
    
I think you would have to write the refiner (Display Templates\Filter) your self to achieve this. Unless you apply the sort order to the Search Core Results. I have not tried that. –  Matthew McDermott Sep 12 '13 at 11:57
    
I was able to acheive this by using custom JS code. –  NYTom Sep 16 '13 at 14:46
    
Can you share the solution you found? –  Matthew McDermott Sep 17 '13 at 12:37
    
See my answer below. –  NYTom Sep 18 '13 at 13:50

I figured a way to do this.

  1. I created a new column called "Order". The order column contained unqiue numeric values in the order to be sorted in.

  2. Then I created a new calculated column called "OrderBy" which took the "Order" & ":" & "Title" column.

  3. In search schema I associated a refinementstring to this new column.

  4. I then created a custom Display template filter.

  5. In the custom display template filter (Which I copied from the out of the box one), there is a function called "outputFilter".

  6. I took the refinementName parameter value from "outputFilter" function and stripped off the "Number:" prefix from calulcated column. For example the calculated column returned 5:Some Title. My javascript would strip off "5:" so now the refinement would show just "Some Title" in the refinement panel but yet it was sorted by the number.

share|improve this answer
    
That sounds like so much work. Are you certain that you are using numeric values all the way from the Column through to the managed property? –  Matthew McDermott Sep 18 '13 at 21:14

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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