lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Høydahl <>
Subject Re: Sorting function with condition
Date Mon, 23 May 2011 09:18:22 GMT

Could be possible if we implement

Until then, perhaps you can try to pre-calculate a sort field during indexing, based on input

You can also emulate an if() function using map() function

Jan Høydahl, search solution architect
Cominvent AS -

On 21. mai 2011, at 23.07, ngaurav2005 wrote:

> Hi all,
> I had to do sorting on search results based on some condition inside sort
> function. Let me put forward with example:
> Query: q=timestamp:123454321&sort=somefunction asc 
> But this "Somefunction" has to have if condition inside it, like
> If age =10, sum(value,x) 
> Else sum(value,y)
> Actually somefunction is sum of (value,x) or (value,y) based on age
> condition. 
> How to handle with this situation in solr search. I was trying to do with
> solr math functions using sort parameter in query, but it donot supports if
> condition. Is there any way to do this programatically(java)/solr plugin. I
> am new to solr, so please help me complete set of details. 
> Thanks in anticipation.
> Gaurav
> --
> View this message in context:
> Sent from the Solr - User mailing list archive at

View raw message