How dynamic are those numbers? If this expression can be computed at index time into a "sort_order" field, that'd be best. Otherwise, if these factors are truly dynamic at run-time, look at the function query sorting capability here: <http://wiki.apache.org/solr/FunctionQuery#Sort_By_Function> and build up the expression from there. I still encourage you to aim towards computing as much of this at index-time as possible to minimize the functions (and thus caches) you need at query time.
Erik On Jul 26, 2012, at 03:47 , lavesh wrote: > am working on solr for search. I required to perform a expression sort such > that > > ORDER BY (IF(COUNTRY=1,100,0) + IF(AVAILABLE=2,1000,IF(AVAILABLE=1,60,0)) + > IF (DELIVERYIN IN (5,6,7),100,IF (DELIVERYIN IN (80,90),50,0))) DESC > > can anyone tell me hows is this possible? > > > > -- > View this message in context: > http://lucene.472066.n3.nabble.com/Expression-Sort-in-Solr-tp3997369.html > Sent from the Solr - User mailing list archive at Nabble.com.