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.


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.

| 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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