Solr:如何自定义分数 [英] Solr: how to custom score

查看:142
本文介绍了Solr:如何自定义分数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用solr 4.5.

I'm using solr 4.5.

我想在我的公式"中使用termFreq和PhraseFreq(取决于查询中是否有术语或短语)来自定义solr分数.

I would like to customize solr score using in my "formula" the termFreq and PhraseFreq (it depend if in the query i have an term or a phrase).

现在我在url请求中使用了参数:

Now I'm using in a url request the param:

sort=myFormula desc

它有效,但是我的问题是在输出中我还想要我的公式的输出,现在的解决方案是将公式也放入fl参数或自定义得分:),我正在寻找最后一个解决方案.

it works but my problem is that in output i want also the output of my formula, now the solution is or to put the formula also into fl param or to customize the score :) and i'm looking for the last one solution.

请,您有什么建议或链接/指南可以让我了解如何自定义solr分数吗?我正在google上搜索,但没有相关结果.

Please, do you have any suggest or link/guide to give me to learn how is it possible customize the solr score? I'm searching on google but no results relevant.

谢谢.

推荐答案

如何实现自己的CustomScoreQuery?第二个示例此处以及这篇博客文章讨论了如何做到这一点.

How about implementing your own CustomScoreQuery? The second example here as well as this blog post talk about how to do it.

这篇关于Solr:如何自定义分数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆