【发布时间】:2019-07-03 18:02:50
【问题描述】:
我使用了以下请求
http://localhost:8983/solr/test6/select?q=*:*&sort=product(score,hits)%20desc
根据 Apache Solr 确定的相关性分数乘以一个称为命中(整数)的字段对结果进行排序。
但是,我收到以下错误消息:
{ "responseHeader":{
"status":400,
"QTime":0,
"params":{
"q":"*:*",
"sort":"product(score,hits) desc"}}, "error":{
"metadata":[
"error-class","org.apache.solr.common.SolrException",
"root-error-class","org.apache.solr.common.SolrException"],
"msg":"sort param could not be parsed as a query, and is not a field that exists in the index: product(score,hits)",
"code":400}}
为什么sort在以下情况下不能正确输入函数值:
http://localhost:8983/solr/test6/select?q=*:*&sort=score%20desc
http://localhost:8983/solr/test6/select?q=*:*&sort=hits%20desc
在不应用函数时工作?
注意:http://localhost:8983/solr/test6/select?q=*:*&sort=product(hits,2)%20desc 我在其中添加 product() 函数也返回相同的错误消息。
【问题讨论】:
标签: apache sorting search solr field