You'll have to add some logic in your Velocity templates string process the 
sort parameter and determine whether to set the link to be "asc"ending or 
"desc"ending.  It'll require learning some Velocity techniques to do this with 
#if and how to navigate the objects Solr puts into the Velocity context.  
You'll find pointers to more information here: 
http://wiki.apache.org/solr/VelocityResponseWriter

I know this doesn't quite get you there without you doing the homework, but 
maybe there'll be enough pointers in that wiki page to get you there.

I've done this in various one-off cases, but nothing handy to share at the 
moment (I'm traveling), but maybe in a week or so I'll be able to dig something 
out or re-craft the voodoo.

        Erik


On Jul 13, 2011, at 14:23 , okayndc wrote:

> Thanks Eric.
> 
> So if I had a link "Sort Title" and the default is &sort=title desc how can
> i switch that to &sort=title asc?
> 
> example:  http://# Sort Tile  (default &sort=title desc)  user clicks on
> link and sort should toggle(or switch) to &sort=title asc
> 
> how can this be achieved?
> 
> 
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/solr-velocity-funtion-for-sorting-asc-desc-tp3163549p3167267.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to