升级到Solr 6时,edismax中的Tilda被忽略

时间:2018-08-28 18:45:28

标签: solr tilde edismax

我有这个字段

 <field name="searchContentEn" type="ft_normalised_en" indexed="true" multiValued="true" stored="true" termVectors="true"/>
 <fieldtype name="ft_normalised_en" class="solr.TextField">
      <analyzer>
        <tokenizer class="solr.KeywordTokenizerFactory"/>
           <filter class="solr.ASCIIFoldingFilterFactory"/>
           <filter class="solr.LowerCaseFilterFactory"/>
           <filter class="solr.StopFilterFactory" words="stopwords_en.txt" ignoreCase="true"/>
           <filter class="solr.PorterStemFilterFactory" />
           <filter class="solr.ShingleFilterFactory" maxShingleSize="2" outputUnigrams="true"/>
     </analyzer>
 </fieldtype>

在Config中,搜索处理程序如下

<requestHandler name="/searchEn" class="solr.SearchHandler">
        <lst name="defaults">
            <!-- Query -->
            <str name="defType">edismax</str>
            <str name="q.op">AND</str>
            <str name="qf">searchContentEn</str>

            <!--Spellchecker -->
            <str name="spellcheck">true</str>
            <str name="spellcheck.dictionary">defaultEn</str>

            <str name="spellcheck.count">3</str>
            <str name="spellcheck.extendedResults">true</str>
            <str name="spellcheck.collate">true</str>
            <str name="spellcheck.collateExtendedResults">true</str>
            <str name="spellcheck.maxCollationTries">5</str>
            <str name="spellcheck.maxCollations">3</str>
        </lst>
        <arr name="last-components">
            <str>spellcheckEn</str>
        </arr>
    </requestHandler>

运行搜索时,parsedquery显示〜由于某种原因被忽略了

"debug": {
    "rawquerystring": "\"name and description\"~6",
    "querystring": "\"name and description\"~6",
    "parsedquery": "(+(+DisjunctionMaxQuery((searchContentEn:name and descript))))/no_coord",
    "parsedquery_toString": "+(+(searchContentEn:name and descript))",
    "explain": {},

仅在Solr6中会发生此问题。在Solr 4.4.0上,按预期使用〜

0 个答案:

没有答案