我怎样才能提高基于参数的SOLR的结果呢? [英] How can I boost a result in SOLR based on a parameter?

查看:111
本文介绍了我怎样才能提高基于参数的SOLR的结果呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来SOLR,我努力提高基于参数国家的结果。

例如,我要在全国设立美国和所有美国的结果移动到顶端。

这是怎么了,现在这样做,但它不工作。

 排序=查询({!QF =市场V ='美国'})递减

这是dismax请求处理程序是如何设置的:

 < requestHandler NAME =dismax级=solr.SearchHandler>
    < LST NAME =默认>
     < STR NAME =DEFTYPE> dismax< / STR>
     < STR NAME =echoParams>明确< / STR>
     <浮动NAME =扎> 0.01 LT; /浮动>
     < STR NAME =QF>
        文字^ 0.5功能^ 1.0 ^名SKU 1.2 1.5 ^ ^ ID马努10.0 ^ 1.1 ^猫1.4
     < / STR>
     < STR NAME =PF>
        文字^ 0.2功能^ 1.1 ^名马努1.5 1.4 ^ ^ manu_exact 1.9
     < / STR>
     < STR NAME =BF>
        人气^ 0.5 RECIP(价格,1,1000,1000)^ 0.3
     < / STR>
     < STR NAME =FL>
        ID,名称,价格,评分
     < / STR>
     < STR NAME =毫米>
        2及下; -1 5和下-2 6和;所述90%
     < / STR>
     < INT NAME =PS> 100℃/ INT>
     < STR NAME =q.alt> *:*< / STR>
     <! - 例如荧光笔配置,使每个查询与HL =真 - >
     < STR NAME =hl.fl>文字特点的名字 - LT; / STR>
     <! - 这个领域,我们希望没有分化,只是强调 - >
     < STR NAME =f.name.hl.fragsize> 0℃; / STR>
     <! - Solr的指示返回现场本身,如果没有查询字词
          发现 - >
     < STR NAME =f.name.hl.alternateField>名称和LT; / STR>
     < STR NAME =f.text.hl.fragmenter>正则表达式< / STR> <! - 定义如下 - >
    < / LST>
  < / requestHandler>


解决方案

如果您正在使用的 dismax / edismax 查询分析器可以按照的方式通过KARTHIK建议。

不过,即使你使用标准的查询分析器,可以查询 Q =市场:美国^ 2 。这应该给你有更多的优先级结果,其中市场:美国

注意:市场是一场与美是它的价值

I am new to SOLR and I am trying to boost a result based on a parameter "country".

For example, I want to set the country to US and move all the results with US to the top.

This is how I am doing it right now but it doesn't work. :

sort=query({!qf=market v='US'}) desc

This is how the dismax request handler is set up:

 <requestHandler name="dismax" class="solr.SearchHandler" >
    <lst name="defaults">
     <str name="defType">dismax</str>
     <str name="echoParams">explicit</str>
     <float name="tie">0.01</float>
     <str name="qf">
        text^0.5 features^1.0 name^1.2 sku^1.5 id^10.0 manu^1.1 cat^1.4
     </str>
     <str name="pf">
        text^0.2 features^1.1 name^1.5 manu^1.4 manu_exact^1.9
     </str>
     <str name="bf">
        popularity^0.5 recip(price,1,1000,1000)^0.3
     </str>
     <str name="fl">
        id,name,price,score
     </str>
     <str name="mm">
        2&lt;-1 5&lt;-2 6&lt;90%
     </str>
     <int name="ps">100</int>
     <str name="q.alt">*:*</str>
     <!-- example highlighter config, enable per-query with hl=true -->
     <str name="hl.fl">text features name</str>
     <!-- for this field, we want no fragmenting, just highlighting -->
     <str name="f.name.hl.fragsize">0</str>
     <!-- instructs Solr to return the field itself if no query terms are
          found -->
     <str name="f.name.hl.alternateField">name</str>
     <str name="f.text.hl.fragmenter">regex</str> <!-- defined below -->
    </lst>
  </requestHandler>

解决方案

If you are using dismax/edismax query parser you can follow the way suggested by Karthik.

But, even if you use the standard query parser, you can query q=market:US^2. This should give you results having more priority where market:US.

Note: "market" is a field and "US" is it's value.

这篇关于我怎样才能提高基于参数的SOLR的结果呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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