Re: Expression Sort in Solr

2012-07-31 Thread Mikhail Khludnev
Hello,

have you tried http://wiki.apache.org/solr/FunctionQuery/#if ?

On Mon, Jul 30, 2012 at 3:05 PM, lavesh lavesh.ra...@gmail.com wrote:

 I am working on solr for search. I required to perform a expression sort
 such
 that :

 say str = ((IF AVAILABLE IN (1,2,3),100,IF(AVAILABLE IN (4,5,6),80,100)) +
 IF(PRICE1000,70,40))

 need to order by (if(str100,40+str/40,33+str/33)+SOMEOTHERCOLUMN) DESC





 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Expression-Sort-in-Solr-tp3998050.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
Sincerely yours
Mikhail Khludnev
Tech Lead
Grid Dynamics

http://www.griddynamics.com
 mkhlud...@griddynamics.com


Re: Expression Sort in Solr

2012-07-31 Thread lavesh
yes i have, its not working as per need



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Expression-Sort-in-Solr-tp3998050p3998310.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Expression Sort in Solr

2012-07-31 Thread Mikhail Khludnev
how exactly?

On Tue, Jul 31, 2012 at 1:19 PM, lavesh lavesh.ra...@gmail.com wrote:

 yes i have, its not working as per need



 --
 View this message in context:
 http://lucene.472066.n3.nabble.com/Expression-Sort-in-Solr-tp3998050p3998310.html
 Sent from the Solr - User mailing list archive at Nabble.com.




-- 
Sincerely yours
Mikhail Khludnev
Tech Lead
Grid Dynamics

http://www.griddynamics.com
 mkhlud...@griddynamics.com


Expression Sort in Solr

2012-07-30 Thread lavesh
I am working on solr for search. I required to perform a expression sort such
that :

say str = ((IF AVAILABLE IN (1,2,3),100,IF(AVAILABLE IN (4,5,6),80,100)) +
IF(PRICE1000,70,40))

need to order by (if(str100,40+str/40,33+str/33)+SOMEOTHERCOLUMN) DESC
 




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Expression-Sort-in-Solr-tp3998050.html
Sent from the Solr - User mailing list archive at Nabble.com.


Expression Sort in Solr

2012-07-26 Thread lavesh
 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.


Re: Expression Sort in Solr

2012-07-26 Thread Erik Hatcher
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.



Re: Expression Sort in Solr

2012-07-26 Thread lavesh
Hi

i know we look to create at index time however all values are dynamic

if(exists(query(COUNTRY:(22 33
44)),100,20),INCOMEhttp://devjs.infoedge.com:8080/solr/select?q=*:*fq=GENDER:FEMALEsort=sum(if(exists(query(AGE:22)),100,20),INCOME
)

IS NOT WORKING
ALSO I NEED NESTED IF

On Thu, Jul 26, 2012 at 8:48 PM, Erik Hatcher-4 [via Lucene] 
ml-node+s472066n3997464...@n3.nabble.com wrote:

 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.



 --
  If you reply to this email, your message will be added to the discussion
 below:

 http://lucene.472066.n3.nabble.com/Expression-Sort-in-Solr-tp3997369p3997464.html
  To unsubscribe from Expression Sort in Solr, click 
 herehttp://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_codenode=3997369code=bGF2ZXNoLnJhd2F0QGdtYWlsLmNvbXwzOTk3MzY5fDYyODA2MjY2MQ==
 .
 NAMLhttp://lucene.472066.n3.nabble.com/template/NamlServlet.jtp?macro=macro_viewerid=instant_html%21nabble%3Aemail.namlbase=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespacebreadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml




-- 

Never explain yourself. Your friends don’t need it and
your enemies won’t believe it .




--
View this message in context: 
http://lucene.472066.n3.nabble.com/Expression-Sort-in-Solr-tp3997369p3997475.html
Sent from the Solr - User mailing list archive at Nabble.com.