solr rank值在精确短语搜索中不匹配

时间:2014-06-27 12:28:18

标签: solr lucene solrj solr4

Ex:     技能:((“数据仓库”))^ 10.0

its returns 40 but i expacted only 10

My Solr Version 3.1和我使用以下链接覆盖solr的DefaultSimilarity(Solr Custom Similarity

schema.xml

字段类型

<fieldType name="text_rc" class="solr.TextField" positionIncrementGap="100" autoGeneratePhraseQueries="true">
  <analyzer type="index">        
    <tokenizer class="solr.PatternTokenizerFactory" pattern="[\s|,]+" />         
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
    <charFilter class="solr.MappingCharFilterFactory" mapping="char_mapping.txt"/>
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>        
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="1" catenateNumbers="1" catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/>
  </analyzer>
  <analyzer type="query">     
    <tokenizer class="solr.PatternTokenizerFactory" pattern="[\s|,]+" />      
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<charFilter class="solr.MappingCharFilterFactory" mapping="char_mapping.txt"/>        
    <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
    <filter class="solr.WordDelimiterFilterFactory" generateWordParts="1" generateNumberParts="1" catenateWords="0" catenateNumbers="0" catenateAll="0" splitOnCaseChange="0" splitOnNumerics="0"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> 
  </analyzer>
</fieldType>

字段

<field name="skills" type="text_rc" indexed="true" stored="false" required="false" multiValued="true" />

Solr管理员页面结果

<response>
<lst name="responseHeader">
    <int name="status">0</int>
    <int name="QTime">37</int>
    <lst name="params">
        <str name="indent">on</str>
        <str name="rows">10</str>
        <str name="start">0</str>
        <str name="version">2.2</str>
        <str name="q">skills :( ( "Data Warehouse") )^10.0 </str>
    </lst>
</lst>
<result name="response" numFound="1" start="0" maxScore="40.0">
    <doc><float name="score">40.0</float>
        <str name="empid">1001</str>
    </doc>
</result>

我的调试查询结果

本地主机:8080 / solr的/ CORE0 /选择技能+:(+(+ “数据+仓库” +)+)^ 10.0)+&安培; debugQuery =上

40.0 = (MATCH) sum of:
  40.0 = (MATCH) weight(skills:"data warehouse" in 0), product of:

   20.0 = queryWeight(skills:"data warehouse"), product of:
     2.0 = idf(skills: data=6 warehouse=1)
     10.0 = queryNorm

   2.0 = fieldWeight(skills:"data warehouse" in 0), product of:
     1.0 = tf(phraseFreq=2.0)
     2.0 = idf(skills: data=6 warehouse=1)
     1.0 = fieldNorm(field=skills, doc=0)

如何解决我的问题请指导我。

0 个答案:

没有答案