solr - solr-PorterStemFilterFactory不返回结果

122 2

我正在用solr做一个项目,并且PorterStemFilterFactory有一些问题,

下面是schema.xml的代码:


 <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100" multiValued="true">


 <analyzer type="index">


 <tokenizer class="solr.StandardTokenizerFactory"/>


 <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />


 <!-- in this example, we will only use synonyms at query time


 <filter class="solr.SynonymGraphFilterFactory" synonyms="wn_s.pl" format="wordnet" ignoreCase="true" expand="false"/>


 <filter class="solr.FlattenGraphFilterFactory"/>


 -->


 <filter class="solr.LowerCaseFilterFactory"/>


 <filter class="solr.PorterStemFilterFactory"/>


 </analyzer>


 <analyzer type="query">


 <tokenizer class="solr.StandardTokenizerFactory"/>


 <filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" />


 <filter class="solr.LowerCaseFilterFactory"/>


 <!--<filter class="solr.KStemFilterFactory"/>-->


 <!--<filter class="solr.SynonymGraphFilterFactory" synonyms="wn_s.pl" format="wordnet" ignoreCase="true" expand="true"/>-->


 <filter class="solr.PorterStemFilterFactory"/>


 </analyzer>


 </fieldType>



时间: 原作者:

147 3

字符串字段的存储没有转换,因此,如果存储了The Acquisitions”,则必须精确搜索“ The Acquisitions” 。

在您的情况下,您需要(1)将要查询的值存储在text_general字段中(例如,myfield_t默认情况下映射到text_general字段),并且(2)然后通过该字段运行查询:


q=my_field_t:acquisitions



原作者:
...