You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by spanchal <sa...@gdn-commerce.com> on 2017/06/23 13:25:36 UTC

Sort using If function containing multiple conditions

Hi all,

I am trying to sort my results using a function query.
sort=if(eq(FIELD1,1) AND eq(FIELD2,1),1,0) desc

but this is giving error:
"error":{
    "metadata":[
      "error-class","org.apache.solr.common.SolrException",
      "root-error-class","org.apache.solr.common.SolrException"],
    "msg":"Can't determine a Sort Order (asc or desc) in sort spec
'if(eq(FIELD1,1) AND eq(FIELD2,1),1,0) desc', pos=16",
    "code":400}}


Although this is working:
sort=if(eq(FIELD1,1),1,0) desc

Can you help how I can sort using If function containing multiple clauses?

Thanks,
Saurabh.



--
View this message in context: http://lucene.472066.n3.nabble.com/Sort-using-If-function-containing-multiple-conditions-tp4342539.html
Sent from the Solr - User mailing list archive at Nabble.com.