1
我需要以不區分大小寫的方式過濾查詢(fq)。 我在網上看到的所有解決方案都與編輯文件schema.xml有關。Solr不區分大小寫的查詢
但是,我沒有這個文件,因爲我使用的模式少了Solr(數據驅動的配置集)。
我該如何還能達到這個結果? 非常感謝!
我需要以不區分大小寫的方式過濾查詢(fq)。 我在網上看到的所有解決方案都與編輯文件schema.xml有關。Solr不區分大小寫的查詢
但是,我沒有這個文件,因爲我使用的模式少了Solr(數據驅動的配置集)。
我該如何還能達到這個結果? 非常感謝!
正如您使用managed-schema file
中定義的dynamicField
。 您正在使用模式
爲你的領域也*_ss
圖案作爲name_ss
結束。 在此處,您看到字段*_ss
具有類型字符串,並且這些字符串不會被分析或按照原樣進行索引。
我建議您使用以下dynamicField
<dynamicField name="*_txt" type="text_general" indexed="true" stored="true"/>
這裏text_general
類型是建立像下面的managed-schema
文件
<fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.LowerCaseFilterFactory"/>
<charFilter class="solr.PatternReplaceCharFilterFactory"
pattern="-" replacement=""/>
<charFilter class="solr.PatternReplaceCharFilterFactory"
pattern="." replacement=""/>
</analyzer>
<analyzer type="query">
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
所以,你將有場爲name_txt
。
這是否意味着您正在使用managed-schema.xml? –
編號 非我的內核有這個文件,我只能在config-sets目錄中看到這個文件(默認) – yuz
你在搜索什麼字段..?你知道該字段的fieldType嗎? –