如何要求示例拼写检查器忽略大小写?
我正在使用中显示的所有默认值demo http://wiki.apache.org/solr/SpellCheckComponent#Spell_Checking_Analysis.
现在我看到如果我输入Ancient,它问“你的意思是ancient? “ 我该怎么办 ?
ps:我的 schema.xml 中没有任何包含“spell”一词的内容!!!!运作如何?
该模式应该有一个名为“spell”的字段类型,用于拼写检查。这将小写拼写检查器使用的所有单词,因此您不必担心大小写。以下是如何使用此字段类型的示例。
在架构中创建一个字段以进行拼写检查。
<field name="spelling" type="spell" indexed="true" stored="false"/>
然后使用复制字段将数据复制到该字段中。在示例中,下面的代码会将“product_name”字段复制到拼写检查器中。
<copyField source="product_name" dest="spelling"/>
Edit...
抱歉...我虽然“拼写”字段类型位于默认架构中。将其添加到架构中与其他 fieldType 标记相同的部分。
<fieldType name="spell" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt"
ignoreCase="true" expand="true"/>
<filter class="solr.StopFilterFactory" ignoreCase="true"
words="stopwords.txt"/>
<filter class="solr.StandardFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory" />
<filter class="solr.RemoveDuplicatesTokenFilterFactory"/>
</analyzer>
</fieldType>
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)