Solr dismax boost 查询不起作用
我的 solr 索引中存储了一些视频标题。我根据标题进行查询,但希望评级能够影响分数。该评级是典型的 5 星级评级。该评级与视频一起存储在 solr 中。我尝试使用 dismax 请求处理程序,但看起来 solr 没有提升值。
您可以在下面看到我的 requestHandler:
<requestHandler default="true" name="dismax" class="solr.SearchHandler" >
<lst name="dismax">
<str name="defType">dismax</str>
<str name="echoParams">explicit</str>
<float name="tie">0.01</float>
<str name="qf">
title
</str>
<str name="pf">
title
</str>
<str name="mm">
0
</str>
<str name="bq">
rating:1^1.0 rating:2^1.0 rating:3^3.0 rating:4^5.0 rating:5^10.0
</str>
<str name="fl">
*,score
</str>
<int name="ps">100</int>
<str name="q.alt">*:*</str>
</lst>
希望有人可以帮助我!
我使用调试运行查询,这是调试的输出。在分数计算中看不到评分字段...
4.429465 = (MATCH) 权重(标题:1894 年测试),乘积:
0.99999994 = queryWeight(标题:测试),乘积:4.4294653 = idf(docFreq=26876, maxDocs=829428) 0.22576088 = 查询范数 4.4294653 = (MATCH) fieldWeight(标题:1894 年的测试),乘积:1.0 = tf(termFreq(标题:测试)=1) 4.4294653 = idf(docFreq=26876, maxDocs=829428) 1.0 = fieldNorm(field=title, doc=1894)
更多调试信息:
<lst name="debug">
<str name="rawquerystring">test</str>
<str name="querystring">test</str>
<str name="parsedquery">title:test</str>
<str name="parsedquery_toString">title:test</str>
<lst name="explain">...</lst>
<str name="QParser">LuceneQParser</str>
<arr name="filter_queries">
<str/>
</arr>
<arr name="parsed_filter_queries"/>
<lst name="timing">...</lst>
</lst>
I have some video titles stored in my solr index. I query based on title but want to have the rating to influence the score. The rating is a typical 5star rating. This rating is stored within solr along with the videos. I tried using the dismax request handler but looks like solr isn't boosting values.
You can see my requestHandler below:
<requestHandler default="true" name="dismax" class="solr.SearchHandler" >
<lst name="dismax">
<str name="defType">dismax</str>
<str name="echoParams">explicit</str>
<float name="tie">0.01</float>
<str name="qf">
title
</str>
<str name="pf">
title
</str>
<str name="mm">
0
</str>
<str name="bq">
rating:1^1.0 rating:2^1.0 rating:3^3.0 rating:4^5.0 rating:5^10.0
</str>
<str name="fl">
*,score
</str>
<int name="ps">100</int>
<str name="q.alt">*:*</str>
</lst>
Hope that someone can help me out!
I run the query with debug,This is the output of the debug. Can't see the rating field in the calculation of score...
4.429465 = (MATCH) weight(title:test in 1894), product of:
0.99999994 = queryWeight(title:test), product of: 4.4294653 =
idf(docFreq=26876, maxDocs=829428) 0.22576088 = queryNorm 4.4294653 =
(MATCH) fieldWeight(title:test in 1894), product of: 1.0 =
tf(termFreq(title:test)=1) 4.4294653 = idf(docFreq=26876,
maxDocs=829428) 1.0 = fieldNorm(field=title, doc=1894)
Some more debug information:
<lst name="debug">
<str name="rawquerystring">test</str>
<str name="querystring">test</str>
<str name="parsedquery">title:test</str>
<str name="parsedquery_toString">title:test</str>
<lst name="explain">...</lst>
<str name="QParser">LuceneQParser</str>
<arr name="filter_queries">
<str/>
</arr>
<arr name="parsed_filter_queries"/>
<lst name="timing">...</lst>
</lst>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎您已将列表定义为 dismax 而不是默认值 -
对我来说效果很好 -
Seems you have defined the list as dismax instead of defaults -
worked fine for me -