【问题标题】:unable to understand sorting data on query solr无法理解查询 solr 上的排序数据
【发布时间】:2018-01-05 09:51:38
【问题描述】:

我正在尝试理解我在旧代码中找到的 solr 排序子句 -

q=*:*
sort=product(if(salesAmount,salesAmount,0.05), query($sortbq)) desc,
sortbq=*:*^10.000 brand:"nike"^1.600
fl=salesAmount,queryVal:query($sortbq)

结果中的示例文档看起来像 -

<!-- FOR brand=nike -->
<doc>
<double name="salesAmount">91743.75</double>
<str name="brand">Nike</str>
<float name="queryVal">2.3159266</float>
</doc>
<!-- FOR brand!=nike -->
<doc>
<str name="prdId">1070694</str>
<double name="sls_amt">92660.75</double>
<str name="brand">Lee</str>
<float name="queryVal">0.19959758</float>
</doc>

谁能解释一下这个query($sortbq)) 是如何计算一个单一的值来进行排序的?我尝试使用 debug=true 进行 solr 查询,并在调试部分获取以下值 -

<str name="1139424">
1.0 = *:*, product of: 1.0 = boost 1.0 = queryNorm
</str>
<str name="1011619">
1.0 = *:*, product of: 1.0 = boost 1.0 = queryNorm
</str>

PS : 如果有人选择否决这个问题,请在 cmets 中说明原因。

【问题讨论】:

    标签: sorting solr lucene


    【解决方案1】:

    请尝试将您的排序子句放在 solr 查询的 bq 中并输入“debug.explain.structured=true” 您会发现排序分数是如何计算的。

    【讨论】:

    • nitendra 非常感谢..这正是我想要的..!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-07-13
    • 2015-09-18
    • 1970-01-01
    相关资源
    最近更新 更多