Solr boost查询(bq)无法正常工作

时间:2015-02-02 12:12:47

标签: solr solr4

我有solr docs有这两个字段:

seller_id 
rater_id

这些字段在schema.xml中定义如下:

<field name="seller_id" type="string" indexed="true" stored="true" docValues="false" multiValued="false" omitNorms="true"/>
<field name="rater_id" type="string" indexed="true" stored="true" docValues="false" multiValued="false" omitNorms="true"/>

现在我在使用

运行solr查询时
<core_name>/select?defType=dismax&q.alt=\*:*&**bq=seller_id:(1053 OR 1142)^900 rater_id:(1053 OR 1142)^700**&rows=2&start=0&fl=seller_id,rater_id,id&debugQuery=true

我得到以下输出:

<doc>
    <str name="id">940_RR591</str>
    <str name="seller_id">940</str>
    <str name="rater_id">1053</str>
</doc>
<doc>
    <str name="id">1142_0</str>
    <str name="seller_id">1142</str>
</doc>

我期待的是与此相反的顺序。

调试查询特定输出是:

    <lst name="explain"><str name="940_RR591">
1.8399739 = (MATCH) sum of:
  8.860351E-5 = (MATCH) MatchAllDocsQuery, product of:
    8.860351E-5 = queryNorm
  1.8398854 = (MATCH) product of:
    3.6797707 = (MATCH) sum of:
      3.6797707 = (MATCH) weight(rater_id:1053 in 4) [DefaultSimilarity], result of:
        3.6797707 = score(doc=4,freq=1.0 = termFreq=1.0
), product of:
          0.4777326 = queryWeight, product of:
            7.7025743 = idf(docFreq=1, maxDocs=1629)
            0.06202246 = queryNorm
          7.7025743 = fieldWeight in 4, product of:
            1.0 = tf(freq=1.0), with freq of:
              1.0 = termFreq=1.0
            7.7025743 = idf(docFreq=1, maxDocs=1629)
            1.0 = fieldNorm(doc=4)
    0.5 = coord(1/2)
</str><str name="1142_0">
1.6587491 = (MATCH) sum of:
  8.860351E-5 = (MATCH) MatchAllDocsQuery, product of:
    8.860351E-5 = queryNorm
  1.6586605 = (MATCH) product of:
    3.317321 = (MATCH) sum of:
      3.317321 = (MATCH) weight(seller_id:1142 in 422) [DefaultSimilarity], result of:
        3.317321 = score(doc=422,freq=1.0 = termFreq=1.0
), product of:
          0.51432836 = queryWeight, product of:
            6.4498115 = idf(docFreq=6, maxDocs=1629)
            0.07974316 = queryNorm
          6.4498115 = fieldWeight in 422, product of:
            1.0 = tf(freq=1.0), with freq of:
              1.0 = termFreq=1.0
            6.4498115 = idf(docFreq=6, maxDocs=1629)
            1.0 = fieldNorm(doc=422)
    0.5 = coord(1/2)
</str></lst>

0 个答案:

没有答案