solr中的计算字段规范对于不同大小的字段是相同的

时间:2013-09-25 11:34:36

标签: solr field ranking norm edismax

我在Solr中创建了两个文档:

<doc>
  <float name="score">1.00711</float>
  <str name="_id">ejn01:2560000000075596</str>
  <str name="title">Journal of neurology research</str>
</doc>
<doc>
  <float name="score">1.00711</float>
  <str name="_id">ejn01:954925518616</str>
  <str name="title">Journal of neurology</str>
</doc>

字段“title”在schema.xml中具有以下定义:

<fieldType name="utf8text" class="solr.TextField" positionIncrementGap="100" omitNorms="false">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory" maxTokenLength="1024"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.ASCIIFoldingFilterFactory"/>
    <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" format="solr" ignoreCase="false" expand="true" tokenizerFactory="solr.WhitespaceTokenizerFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory" maxTokenLength="1024"/>
    <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.ASCIIFoldingFilterFactory"/>
    <filter class="solr.SynonymFilterFactory" synonyms="index_synonyms.txt" format="solr" ignoreCase="false" expand="true" tokenizerFactory="solr.WhitespaceTokenizerFactory"/>
  </analyzer>
</fieldType>

如果我使用查询“神经病学杂志”,两个文件都有相同的分数, 第二个文件更准确。提供短语查询无法解决问题。我还看到两个文档的计算 fieldNorm都是“0.5”。这有什么关系吗? 将长度范数存储到一个字节时会丢失精度吗?

这些是所有提供的参数(solrconfig.xml中的默认值):

<str name="lowercaseOperators">false</str>
<str name="mm">-10%</str>
<str name="pf">author^3 title^2</str>
<str name="sort">score desc</str>
<arr name="bq">
  <str>source:ser01^10</str>
  <str>source:ejn01^10</str>
 <str>(*:* -type:article)^999</str>
</arr>
<str name="echoParams">all</str>
<str name="df">all</str>
<str name="tie">0</str>
<str name="qf">
author^15 title^10 subject^1 summary^1 library^1 location^1 publisher^1 place_published^1 issn^1 isbn^1
</str>
<str name="q.alt">*:*</str>
<str name="ps">2</str>
<str name="defType">edismax</str>
<str name="q">journal of neurology</str>
<str name="echoParams">all</str>
<str name="sort">score desc</str>

看看得分的计算,我发现它们之间没有任何区别

<str name="ejn01:2560000000075596">
1.0071099 = (MATCH) sum of:
  0.0053001107 = (MATCH) sum of:
    0.0017667036 = (MATCH) max of:
      0.0017667036 = (MATCH) weight(title:journal^10.0 in 0), product of:
        0.005943145 = queryWeight(title:journal^10.0), product of:
          10.0 = boost
          0.5945349 = idf(docFreq=2, maxDocs=2)
          9.996294E-4 = queryNorm
        0.29726744 = (MATCH) fieldWeight(title:journal in 0), product of:
          1.0 = tf(termFreq(title:journal)=1)
          0.5945349 = idf(docFreq=2, maxDocs=2)
          0.5 = fieldNorm(field=title, doc=0)
    0.0017667036 = (MATCH) max of:
      0.0017667036 = (MATCH) weight(title:of^10.0 in 0), product of:
        0.005943145 = queryWeight(title:of^10.0), product of:
          10.0 = boost
          0.5945349 = idf(docFreq=2, maxDocs=2)
          9.996294E-4 = queryNorm
        0.29726744 = (MATCH) fieldWeight(title:of in 0), product of:
          1.0 = tf(termFreq(title:of)=1)
          0.5945349 = idf(docFreq=2, maxDocs=2)
          0.5 = fieldNorm(field=title, doc=0)
    0.0017667036 = (MATCH) max of:
      0.0017667036 = (MATCH) weight(title:neurology^10.0 in 0), product of:
        0.005943145 = queryWeight(title:neurology^10.0), product of:
          10.0 = boost
          0.5945349 = idf(docFreq=2, maxDocs=2)
          9.996294E-4 = queryNorm
        0.29726744 = (MATCH) fieldWeight(title:neurology in 0), product of:
          1.0 = tf(termFreq(title:neurology)=1)
          0.5945349 = idf(docFreq=2, maxDocs=2)
          0.5 = fieldNorm(field=title, doc=0)
  0.0031800664 = (MATCH) max of:
    0.0031800664 = (MATCH) weight(title:"journal of neurology"~2^2.0 in 0), product of:
      0.0035658872 = queryWeight(title:"journal of neurology"~2^2.0), product of:
        2.0 = boost
        1.7836046 = idf(title: journal=2 of=2 neurology=2)
        9.996294E-4 = queryNorm
      0.8918023 = fieldWeight(title:"journal of neurology" in 0), product of:
        1.0 = tf(phraseFreq=1.0)
        1.7836046 = idf(title: journal=2 of=2 neurology=2)
        0.5 = fieldNorm(field=title, doc=0)
  0.99862975 = (MATCH) sum of:
    0.99862975 = (MATCH) MatchAllDocsQuery, product of:
      0.99862975 = queryNorm
</str>
<str name="ejn01:954925518616">
1.0071099 = (MATCH) sum of:
  0.0053001107 = (MATCH) sum of:
    0.0017667036 = (MATCH) max of:
      0.0017667036 = (MATCH) weight(title:journal^10.0 in 1), product of:
        0.005943145 = queryWeight(title:journal^10.0), product of:
          10.0 = boost
          0.5945349 = idf(docFreq=2, maxDocs=2)
          9.996294E-4 = queryNorm
        0.29726744 = (MATCH) fieldWeight(title:journal in 1), product of:
          1.0 = tf(termFreq(title:journal)=1)
          0.5945349 = idf(docFreq=2, maxDocs=2)
          0.5 = fieldNorm(field=title, doc=1)
    0.0017667036 = (MATCH) max of:
      0.0017667036 = (MATCH) weight(title:of^10.0 in 1), product of:
        0.005943145 = queryWeight(title:of^10.0), product of:
          10.0 = boost
          0.5945349 = idf(docFreq=2, maxDocs=2)
          9.996294E-4 = queryNorm
        0.29726744 = (MATCH) fieldWeight(title:of in 1), product of:
          1.0 = tf(termFreq(title:of)=1)
          0.5945349 = idf(docFreq=2, maxDocs=2)
          0.5 = fieldNorm(field=title, doc=1)
    0.0017667036 = (MATCH) max of:
      0.0017667036 = (MATCH) weight(title:neurology^10.0 in 1), product of:
        0.005943145 = queryWeight(title:neurology^10.0), product of:
          10.0 = boost
          0.5945349 = idf(docFreq=2, maxDocs=2)
          9.996294E-4 = queryNorm
        0.29726744 = (MATCH) fieldWeight(title:neurology in 1), product of:
          1.0 = tf(termFreq(title:neurology)=1)
          0.5945349 = idf(docFreq=2, maxDocs=2)
          0.5 = fieldNorm(field=title, doc=1)
  0.0031800664 = (MATCH) max of:
    0.0031800664 = (MATCH) weight(title:"journal of neurology"~2^2.0 in 1), product of:
      0.0035658872 = queryWeight(title:"journal of neurology"~2^2.0), product of:
        2.0 = boost
        1.7836046 = idf(title: journal=2 of=2 neurology=2)
        9.996294E-4 = queryNorm
      0.8918023 = fieldWeight(title:"journal of neurology" in 1), product of:
        1.0 = tf(phraseFreq=1.0)
        1.7836046 = idf(title: journal=2 of=2 neurology=2)
        <b>0.5 = fieldNorm(field=title, doc=1)
  0.99862975 = (MATCH) sum of:
    0.99862975 = (MATCH) MatchAllDocsQuery, product of:
      0.99862975 = queryNorm
</str>

知道为什么fieldNorm对于两个文件都是一样的吗?

提前致谢!

0 个答案:

没有答案