用子查询解决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}))

相关推荐