Dismax请求处理程序 [英] Dismax Request Handler

查看:146
本文介绍了Dismax请求处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用solr按名称搜索一组数据(例如"Dan"或"Joe Smith").我想按另一个索引字段double_score(例如10.0或72.3)指定的顺序返回查询所指定的结果(最后带有通配符).我目前有以下根本无法使用的东西:

I'm using solr to search a set of data by name (e.g. "Dan" or "Joe Smith"). I'd like to return the results specified by the query (edit: with a wildcard on the end) in an order specified by another indexed field double_score (e.g. 10.0 or 72.3). I currently have the following which fails to work at all:

<!-- Note that the default search is on the field name -->
<requestHandler name="/scoresearch" class="solr.SearchHandler" default="true">
   <!-- <lst name="invariants">
          <str name="q">{!boost b=sum(double_score) defType=dismax v=$qq}</str>
        </lst> -->
        <lst name="defaults">
          <str name="defType">dismax</str>    
          <str name="echoParams">explicit</str>
      <int name="rows">10</int>
     <!-- <str name="qq"></str> -->
      <str name="qf">double_score</str>
      <str name="debug">true</str>
      <str name="q.alt">*:*</str>
    </lst>
</requestHandler>

如果我删除评论,则搜索确实可以正常进行.我所做的任何查询都将被q.alt取代,然后由double_score的值增强.如果不替换q.alt,那将是理想的效果.

If I remove the comments, then the search does work s.t. whatever query I make is replaced by q.alt and then boosted by the value of double_score. If this didn't replace the q.alt, it would be the desired effect.

还请注意,尽管我还没有研究更有趣的可能性,例如将名称标记化,但我确实打算这样做.因此,任何可能的建议/解决方案都不应排除在外.

Also note that while I have not yet delved into more interesting possibilities such as tokenizing the names, I do plan to do so. So any possible suggestion/solution shouldn't preclude that.

推荐答案

我认为您过于复杂了……尝试一下:

I think you're overcomplicating it... try this:

<lst name="defaults">
    <str name="defType">edismax</str>
    <str name="qf">name</str>
    <str name="q.alt">*:*</str>
    <str name="bf">double_score</str>
</lst>

这篇关于Dismax请求处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆