2015-04-28 38 views
0

我的問題: 搜索時,'content'的優先級高於其他字段。Solr qf字段排序對搜索的影響

Solr的搜索請求處理程序:

<requestHandler name="/select" class="solr.SearchHandler"> 
    <lst name="defaults"> 
     <str name="defType">edismax</str> 
     <str name="echoParams">explicit</str> 
     <int name="rows">10</int> 
     <str name="df">text</str> 
     <str name="q.alt">*:*</str> 
     <str name="q.op">AND</str> 
     <str name="qf">title^15.0 description^9.0 categoryNames^3.0 authorName^1.0 content^1.0</str> 
     <str name="boost">scoreA</str> 
    </lst> 
    <lst name="appends"> 
     <str name="fq">private:false</str> 
     <str name="fq">deleted:false</str> 
     <str name="fq">draft:false</str> 
    </lst> 
    </requestHandler> 

下面是從我的Solr響應得分:

100% 0.003303376 ((content:world | title:world^15.0 | categoryNames:world^3.0 | description:world^9.0 | authorName:world) (content:war | title:war^15.0 | categoryNames:war^3.0 | description:war^9.0 | authorName:war))~2,FileFloatSource(field=scoreA,keyField=id,defVal=0.0,dataDir=/opt/solr/current/data/resource/) 
0.95% 0.005617031 sum of the following: 
0.27% 0.0016038928 (MATCH) max of: 
0.27% 0.0016038928 content:world 
0.68% 0.004013138 (MATCH) max of: 
0.68% 0.004013138 content:war 
99.05% 0.5881  float(scoreA{type=ext_resource_float,properties=indexed,stored,omitTermFreqAndPositions})=0.5881 

得分的明細:http://explain.solr.pl/explains/73itib4r

從我所看到的, '內容'正在成爲重中之重。不知道爲什麼會這樣,因爲我在我的Solr qf字段中有最後一個。

我需要'內容'是最低的衝擊和最高的標題。

回答

1

您的parsedQuery (content:world | title:world^15.0 | categoryNames:world^3.0 | description:world^9.0 | authorName:world) (content:war | title:war^15.0 | categoryNames:war^3.0 | description:war^9.0 | authorName:war))中的訂單並不意味着第一個字段是前一個字段。唯一重要的是每個領域的重量。

爲了證明這一點,你可以看到你的內容字段僅代表你的總得分的0.27%,這是該行爲要:

0.27% 0.0016038928 (MATCH) max of: 0.27% 0.0016038928 content:world