Solr得分未正确排序

时间:2014-10-15 09:01:36

标签: sorting solr

分数排序不再正确。

textfield setup:

<!-- Danish -->
    <fieldType name="text_da" class="solr.TextField" positionIncrementGap="100">
      <analyzer type="index">
        <tokenizer class="solr.StandardTokenizerFactory"/>
        <filter class="solr.LowerCaseFilterFactory"/>
        <filter class="solr.SnowballPorterFilterFactory" language="Danish"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_da.txt" format="snowball" /> 
      </analyzer>
      <analyzer type="query">
        <tokenizer class="solr.StandardTokenizerFactory"/>    
        <filter class="solr.LowerCaseFilterFactory"/>       
        <filter class="solr.SnowballPorterFilterFactory" language="Danish"/>
        <filter class="solr.StopFilterFactory" ignoreCase="true" words="lang/stopwords_da.txt" format="snowball" />     
        <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" />
      </analyzer>
    </fieldType>

处理程序:

<requestHandler name="/solarquery" class="solr.SearchHandler">
     <lst name="defaults">
       <str name="echoParams">all</str>
       <str name="wt">json</str>
       <str name="indent">true</str>
       <str name="df">text</str>
       <!-- Query settings -->
       <str name="defType">edismax</str>
       <str name="mm">100%</str>
       <str name="q.alt">*:*</str>
       <str name="rows">10</str>
       <str name="fl">*,score</str>
       <str name="facet">on</str>
       <int name="facet.limit">10</int>
       <int name="facet.mincount">1</int>
       <str name="facet.field">category</str>
       <str name="facet.field">brand_exact</str>
       <str name="facet.field">articletype</str>
       <str name="facet.field">oncw</str>
       <str name="facet.field">concepts</str>
       <str name="facet.field">features</str>
     </lst>
     <arr name="last-components">
      <str>elevator</str>
    </arr>
  </requestHandler>

当我运行基本查询时:solarquery?q = toilet&amp; wt = json&amp; sort = score desc&amp; indent = true&amp; debugQuery = true

分数未正确排序:

(MATCH) sum of:\n  2.6150227 =,...
(MATCH) sum of:\n  3.1380272 =,...
(MATCH) sum of:\n  3.1380272 =,...
(MATCH) sum of:\n  3.1380272 =,...
(MATCH) sum of:\n  3.1380272 =,...
(MATCH) sum of:\n  2.9585605 =,...
(MATCH) sum of:\n  2.9585605 =,...
(MATCH) sum of:\n  2.9585605 =,...
(MATCH) sum of:\n  2.9585605 =,...
(MATCH) sum of:\n  2.9585605 =,...

我认为问题与处理程序有关,但我不知道问题是什么?

Rgds Leif

1 个答案:

答案 0 :(得分:0)

  • 检查您的查询提升文件,可能第一个文档包含在elevate.xml文件中。如果你想在没有电梯部件的情况下尝试,看看它是否有所作为,那也是一个很好的测试。

  • 您也不必提及sort = score desc,因为这是默认行为。