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

Using MOSS 2007. The only OOtB options for sorting search center results are Relevance and Modified Date. There doesn't seem to be a way to do it through the XSL. I was wondering if and how I could extend this (sort by Created for example, and it doesn't have to be a selectable option...it can be ONLY that). I assume this needs to be done programmatically which I'm comfortable with. I'm not asking for the code for how to do it (though it's welcome!) but more of an explanation on how to go about it, if possible. What classes to use, etc. to make the behavior the same as if it were built into the search center.

I've been googling for hours and I can't find what I need. Thanks for any help you can offer.

share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

Yes, you will need to implement a custom solution to accomplish this. The OOTB results Web part is unfortunately hard-coded for sorting by relevance or modified date. This limitation is first removed with SharePoint 2013 Search where managed properties can now be registered as sortable.

In SharePoint 2007, you can implement custom sorting using the KeywordQuery class. Add the property or properties to sort by to the SortList collection.

I have also found this code example for you.

share|improve this answer
    
Thank you. This is what I was looking for. Sorry for the delay in getting back to you. –  David King Sep 5 '12 at 23:53
    
No worries - glad to hear it worked out for you. –  Lars Fastrup Sep 6 '12 at 7:39
add comment

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.