用子查询解决solr评分计算的问题

思路是用子查询得出分数,然后用solr的自有的函数进行计算

 

http://127.0.0.1:8983/solr/collection1/select?q=text:思源科技研发事业部toon基础平台李&wt=json&indent=true&fl=*,score

http://127.0.0.1:8983/solr/collection1/select?q=text:思源科技研发事业部toon基础平台李&wt=json&indent=true&sort=product(socialLevel, query({!dismax v='思源科技研发事业部toon基础平台李'})) desc&fl=*,score

http://127.0.0.1:8983/solr/collection1/select?q=text:思源科技研发事业部toon基础平台李&wt=json&indent=true&sort=product(sum(socialLevel,consumeLevel), query({!dismax v='思源科技研发事业部toon基础平台李'})) desc&fl=*,score,dd:product(sum(socialLevel,consumeLevel), query({!dismax v='思源科技研发事业部toon基础平台李'}))

 

 

http://172.28.4.84:11010/solr/feed_shard2_replica3/select?q=title:%E6%9D%8E%E8%92%99&wt=json&indent=true&sort=product(sum(socialLevel,consumeLevel,serviceLevel),%20query({!dismax%20qf=title%20v=%27%E6%9D%8E%E8%92%99%27}))%20desc&fl=feedId,score,dd:product(sum(socialLevel,consumeLevel,serviceLevel),%20query({!dismax%20qf=title%20v=%27%E6%9D%8E%E8%92%99%27}))

 

http://172.28.4.84:11010/solr/feed_shard2_replica3/select?q=title:%E6%9D%8E%E8%92%99&wt=json&indent=true&sort=product(sum(socialLevel,consumeLevel,serviceLevel),%20query({!dismax%20qf='title subtitle'%20v=%27%E6%9D%8E%E8%92%99%27}))%20desc&fl=feedId,score,dd:product(sum(socialLevel,consumeLevel,serviceLevel),%20query({!dismax%20qf='title subtitle'%20v=%27%E6%9D%8E%E8%92%99%27}))

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值