Announcing custom sort order support for WildcardSearchWebPart

Posted Wednesday, May 20, 2009 8:56 AM by CoreyRoth

I was reading the forums the other day and saw another post in the MOSS Search forum about someone wanting to be able to specify a custom sort order with the CoreResultsWebPart.  WildcardSearchWebPart will allow you to specify a static full text sql query or it builds one of its own.  The problem is, the CoreResultsWebPart that it inherits from has logic in it to go and add an ORDER BY clause based on data modified or relevance.  This causes an issue because if you specify your own order by clause, it causes a syntax error. This post had a rather simple solution to solving the issue.  The answer is to simply add your own ORDER BY clause followed by a -- (SQL comment).  This causes the syntax to be valid and everything works.

After seeing this, I immediately knew I wanted to add this to the WildcardSearchWebPart.  I added a new property called SortOrder which would allow you pass any valid ORDER BY clause.  For example:

  • Title
  • Author DESC
  • ContentSource, Author DESC, Title

You should be able to sort on any manager property that you have returned in the Select Columns XML field.  Give it a try and see how it works.  My next step to research is to see if I can implement this with a keyword query.  Try it out and post any issues you run into on CodePlex.

Wildcard Search Version 1.0 Release 4

Follow me on twitter.

Comments

# re: Announcing custom sort order support for WildcardSearchWebPart

Wednesday, June 1, 2011 6:23 AM by Don

Is there any documentation of th efeatures of this web part.

# SharePoint 2010: Alternativas para personalizar los resultados de las búsquedas (I)!

Monday, April 30, 2012 4:00 AM by Blog del CIIN

Una de las características clave de las búsquedas en SharePoint 2010 es el alto grado de personalización

# SharePoint 2010: Alternativas para personalizar los resultados de las búsquedas (I)! « Pasi??n por la tecnolog??a…

Pingback from  SharePoint 2010: Alternativas para personalizar los resultados de las búsquedas (I)! « Pasi??n por la tecnolog??a…

Leave a Comment

(required) 
(required) 
(optional)
(required)