尽管正确使用了SynonymFilter,但Solr并没有找到同义词短语

时间:2014-03-29 23:36:45

标签: solr

Solr 4.3.0:

我想进入"巴塞尔3"在Solr-searchfield中,想要获得" Basel 3"或者"巴塞尔协议III"。我正确的方法,因为分析器显示与此查询匹配:

http://localhost/solr/analysis/field?analysis.fieldvalue=Basel III&q=Basel:3&analysis.fieldname=description&analysis.showmatch=true

也是搜索"巴塞尔3"显示"巴塞尔协议III"的正确突出显示,恰好在同一结果中。 但是,现在这就是我的问题,所有结果只包含"巴塞尔协议III"不见了。

schema.xml中:

<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
  <analyzer type="index">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.ShingleFilterFactory" minShingleSize="2" maxShingleSize="2" outputUnigramsIfNoShingles="true" />
    <filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true" tokenizerFactory="solr.KeywordTokenizerFactory"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
  <analyzer type="query">
    <tokenizer class="solr.StandardTokenizerFactory"/>
    <filter class="solr.ShingleFilterFactory" minShingleSize="2" maxShingleSize="2" outputUnigramsIfNoShingles="true"/>
    <filter class="solr.LowerCaseFilterFactory"/>
  </analyzer>
</fieldType>

synonyms.txt:

Basel 3, Basel III

&#34;切换已解析的查询&#34;所示:

(+DisjunctionMaxQuery((title:"(basel basel 3) 3"^2.5 | recruiter:basel 3^1.5 | description:"(basel basel 3) 3"^0.5)))/no_coord

修改: 围绕&#34;多字同义词&#34;似乎存在一整套开放性问题: - https://issues.apache.org/jira/browse/LUCENE-2605 - https://issues.apache.org/jira/browse/LUCENE-1622 - https://issues.apache.org/jira/browse/SOLR-4381 (...)

关于此主题的一篇非常有趣的文章:http://nolanlawson.com/2012/10/31/better-synonym-handling-in-solr/

0 个答案:

没有答案