Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/solr/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Solr多值场-相似刻面场_Solr - Fatal编程技术网

Solr多值场-相似刻面场

Solr多值场-相似刻面场,solr,Solr,背景,我正在对一些文档进行一些关键短语提取。这里我有一个术语列表,我想用作上传文档的方面() 我有一个关于结肠癌的术语列表,有一个问题出现了,刻面上说有10个文档有一个特定的术语,但我有400个文档,其中10个实际上包含这个术语,而另外390个没有。我相信这是因为这个词特别包含了另一个词 我正在寻找的术语:无证据 还有一个术语实际上出现了400次:no 类似地,我正在寻找术语:免费,它在所有文档中出现1次,但我得到了31个结果。有一个术语free,显示了31次 这是我的模式: <field

背景,我正在对一些文档进行一些关键短语提取。这里我有一个术语列表,我想用作上传文档的方面() 我有一个关于结肠癌的术语列表,有一个问题出现了,刻面上说有10个文档有一个特定的术语,但我有400个文档,其中10个实际上包含这个术语,而另外390个没有。我相信这是因为这个词特别包含了另一个词

我正在寻找的术语:
无证据
还有一个术语实际上出现了400次:
no
类似地,我正在寻找术语:
免费
,它在所有文档中出现1次,但我得到了31个结果。有一个术语
free
,显示了31次

这是我的模式:

<field name="ColonCancer" type="ColonCancer" indexed="true" stored="true" multiValued="true"
   termPositions="true"
   termVectors="true"
   termOffsets="true"/>
<fieldType name="ColonCancer" class="solr.TextField" sortMissingLast="true" omitNorms="true">
<analyzer>
<filter class="solr.ShingleFilterFactory"
            minShingleSize="2" maxShingleSize="5"
            outputUnigramsIfNoShingles="true"
    />
  <tokenizer class="solr.WhitespaceTokenizerFactory"/>
      <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms_ColonCancer.txt" ignoreCase="true" expand="true" tokenizerFactory="solr.KeywordTokenizerFactory"/>
    <filter class="solr.KeepWordFilterFactory"
            words="prefLabels_ColonCancer.txt" ignoreCase="true"/>
  </analyzer>
</fieldType>

您可以通过多种方式修复此问题

可以将字段更改为字符串字段。这将使facet查询行为变成“特定的”。也就是说,寻找“没有证据”只会发现“没有证据”——区分大小写

另一种选择是使用方面查询-在查找特定组合时。 然后可以使用~simbol在它们之间强制设置一个范围

例如:

<field name="ColonCancer" type="ColonCancer" indexed="true" stored="true" multiValued="true"
termPositions="true"
termVectors="true"
termOffsets="true"/>



您可以通过多种方式解决此问题

可以将字段更改为字符串字段。这将使facet查询行为变成“特定的”。也就是说,寻找“没有证据”只会发现“没有证据”——区分大小写

另一种选择是使用方面查询-在查找特定组合时。 然后可以使用~simbol在它们之间强制设置一个范围

例如:

<field name="ColonCancer" type="ColonCancer" indexed="true" stored="true" multiValued="true"
termPositions="true"
termVectors="true"
termOffsets="true"/>



您能演示我如何将其转换为字符串字段(当前已标记)吗?您能演示我如何将其转换为字符串字段(当前已标记)
 <fieldType name="ColonCancerString" class="solr.StringField">

<analyzer>
 <filter class="solr.ShingleFilterFactory"
        minShingleSize="2" maxShingleSize="5"
        outputUnigramsIfNoShingles="true"
/>
<tokenizer class="solr.WhitespaceTokenizerFactory"/>
  <filter class="solr.LowerCaseFilterFactory"/>
    <filter class="solr.SynonymFilterFactory"     synonyms="synonyms_ColonCancer.txt" ignoreCase="true" expand="true"   tokenizerFactory="solr.KeywordTokenizerFactory"/>
     <filter class="solr.KeepWordFilterFactory"
        words="prefLabels_ColonCancer.txt" ignoreCase="true"/>
  </analyzer>
  </fieldType>
  <copyField source="ColonCancer" dest="ColonCancerString"/>