我用的是 Solr 6.1,
我需要在每个结果中自定义分数,
这是原始结果:
[
{
"_id": "59d2face138d070c14fccd0d",
"plusrnak": 44.623055,
"score": 80.439298
},
{
"_id": "59d2face384eb78b23f60d78",
"plusrnak": 36.508239,
"score": 62.644288
},
{
"_id": "59d2face70750b413d839136",
"plusrnak": 80.446665,
"score": 44.639681
},
{
"_id": "59d2facee507560951445e3d",
"plusrnak": 60.84082,
"score": 38.997843
},
{
"_id": "59d2face415b1ba891dfbb97",
"plusrnak": 6.225893,
"score": 38.279674
},
{
"_id": "59d2facec792d7ff7ade6620",
"plusrnak": 76.954612,
"score": 23.405887
},
{
"_id": "59d2face6958596fce9baa9a",
"plusrnak": 5.903754,
"score": 1.864721
}
]
我想在每个分数中加上字段“plusrnak”值
像这样 :
[
{
"_id": "59d2face70750b413d839136",
"plusrnak": 80.446665,
"score": 125.086346
},
{
"_id": "59d2face138d070c14fccd0d",
"plusrnak": 44.623055,
"score": 125.062353
},
{
"_id": "59d2facec792d7ff7ade6620",
"plusrnak": 76.954612,
"score": 100.360499
},
{
"_id": "59d2facee507560951445e3d",
"plusrnak": 60.84082,
"score": 99.838663
},
{
"_id": "59d2face384eb78b23f60d78",
"plusrnak": 36.508239,
"score": 99.152527
},
{
"_id": "59d2face415b1ba891dfbb97",
"plusrnak": 6.225893,
"score": 44.505567
},
{
"_id": "59d2face6958596fce9baa9a",
"plusrnak": 5.903754,
"score": 7.768475
}
]
怎么做?我可以在配置文件上设置它吗?如何?
或者我可以使用“plusrnak”字段替换分数吗?如果为空或为空,它只使用原始分数?怎么做?