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 Géraud Dugé de Bernonville <ge...@zenika.com> on 2019/07/17 15:03:43 UTC

Using scores in Analytics component

Hi,

I'm using Analytics component (
https://lucene.apache.org/solr/guide/7_7/analytics.html), and would like to
apply some function to the score.

Something like :

curl -d 'q=title:*&rows=0&wt=json&fl=*,score&
> analytics=
> {
>     "expressions" : {
>         "max_score" : "max(score)"
>     }
> }' 'http://localhost:8983/solr/demo/select'
>

But it fails with the exception :

{
>   "responseHeader":{
>     "status":400,
>     "QTime":4,
>     "params":{
>       "analytics":"\n{\n    \"expressions\" : {\n        \"max_score\" :
> \"max(score)\"\n    }\n}",
>       "q":"title:*",
>       "fl":"*,score",
>       "rows":"0",
>       "wt":"json"}},
>   "error":{
>     "metadata":[
>       "error-class","org.apache.solr.common.SolrException",
>       "root-error-class","org.apache.solr.common.SolrException"],
>     "msg":"undefined field: \"score\"",
>     "code":400}}
>

Is there a way to work with scores in Analytics component ?

Thanks !
-- 
Géraud