Sort using If function containing multiple conditions

2017-06-23 Thread spanchal
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.


shard.preference for single shard queries

2019-12-05 Thread spanchal
Hi all, Thanks to  SOLR-11982
   we can now give solr
parameter to sort replicas while giving results but ONLY for distributed
queries as per documentation. May I know why this limitation?

As my setup, I have 3 replicas(2 NRT, 1 PULL) of a single shard on 3
different machines. Since NRT replicas might be busy with indexing, I would
like my queries to land on PULL replica as a preferred option. And
shard.preference=replica.type:PULL is not working in my case. 
Please help, thanks.



--
Sent from: https://lucene.472066.n3.nabble.com/Solr-User-f472068.html