且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

将Solr的文档分数与静态索引分数相结合

更新时间:2023-02-15 17:07:22

您可以尝试实现自定义SearchComponent,该自定义SearchComponent将在Solr上走低谷,并在那里计算自定义分数.从ResponseBuilder(rb.getResults().docSet)中找到结果,然后遍历它们,将计算出的值添加到结果中,然后对其进行重新排序.

You could try to implement custom SearchComponent that will go trough results on Solr and calculate your custom score there. Get results found from ResponseBuilder (rb.getResults().docSet), iterate trough them, add calculated value to your results and re-sort them.

然后您可以将SearchComponent注册为RequestHandler链中的最后一个:

You can then register your SearchComponent as last in RequestHandler chain:

<arr name="last-components">
  <str>elevator</str>
</arr>

SolR手册中的更多信息: http://wiki.apache.org/solr/SearchComponent

More info in SolR manual: http://wiki.apache.org/solr/SearchComponent

对不起,但暂时没有更好的主意.

Sorry, but no better idea for now.