【问题标题】:SOLR sort by score syntaxSOLR 按分数语法排序
【发布时间】:2012-03-13 00:23:45
【问题描述】:

我的 solr webrequest 看起来像这样

http://XXX.XX.XX.XX:8080/search/select?q=bay city&defType=dismax&qf=screenname^10+screenname1^100.0+cmets^50+tagwords^10+spottype^40+spotscene^50+spotscenecategory^50&bq=locationid:22878^40&mm=1&start=0&rows=40reccount desc&fq=locationid:22878 或 查询:"{!bbox}"&sfield=location&pt=34.0194543, -118.4911912&d=8&fl=profileid,screenname1,reccount,score,locationid&sort=score 描述

我在这里使用 &sort=score desc

现在我看起来像@sort=sum(log(popularity),score) desc

但我这样使用它给我错误

排序参数无法解析为查询,并且不是索引中存在的字段:sum(log(popularity),score)

【问题讨论】:

    标签: solr


    【解决方案1】:

    我认为,问题在于score 是一个伪字段,而不是一个实际被索引的字段。也许您可以尝试使用相关函数代替score(如果您使用的是 Solr 4.0)。但是,我认为您要做的是提高基于popularity 的分数。在这种情况下,你会想看这里: http://wiki.apache.org/solr/SolrRelevancyFAQ#How_can_I_change_the_score_of_a_document_based_on_the_.2Avalue.2A_of_a_field_.28say.2C_.22popularity.22.29

    【讨论】:

      【解决方案2】:

      我遇到了同样的问题, 我用这个解决了这个问题:

      &sort=score desc, sum(log(popularity))

      【讨论】:

      • 这与提出的问题无关。您按分数作为第一列排序,如果两个结果具有相同的分数,则使用第二列。此外,您使用的“sum”函数应该有多个变量。
      猜你喜欢
      • 2018-12-02
      • 2015-09-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多