2017-11-17 10 views
0

フィールド値で "apache solr"からの応答をソートしようとしています。 これは私のソート機能である:Solrフィールド値で並べ替え

sort=if(eq(custom_s_doctor_location_key, "advanced imaging center - lake ridge-landing"),1,0) desc 

しかし、私はエラーを取得:

"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(custom_s_doctor_location_key, \"advanced imaging center - lake ridge-landing\"),1,0) desc', pos=35", 
"code":400}}) 

答えて

0

custom_s_doctor_location_keyが数値フィールドの?そうでない場合は、strdistのような他の関数を文字列として比較する必要があります。私は面倒ですが、うまくいくはずです

0

正しいバージョンのSolrを使用していますか? "eq"がsolr 6.2で導入されたようだ。http://yonik.com/solr-6-2/

関連する問題