Solr dismax boost 查询不起作用

发布于 2024-12-06 10:52:33 字数 1788 浏览 2 评论 0原文

我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

未蓝澄海的烟 2024-12-13 10:52:33

似乎您已将列表定义为 dismax 而不是默认值 -

<requestHandler name="dismax" class="solr.SearchHandler" >
    <lst name="defaults">
        <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>
</requestHandler>

对我来说效果很好 -

<str name="parsedquery">(+DisjunctionMaxQuery((title:itunes)~0.01) DisjunctionMaxQuery((title:itunes)~0.01) rating:1 rating:2 rating:3^3.0 rating:4^5.0 rating:5^10.0)/no_coord</str>

Seems you have defined the list as dismax instead of defaults -

<requestHandler name="dismax" class="solr.SearchHandler" >
    <lst name="defaults">
        <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>
</requestHandler>

worked fine for me -

<str name="parsedquery">(+DisjunctionMaxQuery((title:itunes)~0.01) DisjunctionMaxQuery((title:itunes)~0.01) rating:1 rating:2 rating:3^3.0 rating:4^5.0 rating:5^10.0)/no_coord</str>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文