带*的Solr结果为空,没有*我有结果

时间:2015-10-29 12:22:15

标签: indexing solr prefix

我的文本字段值为" object-a1" 当我搜索:object-a时,我得到了对象。 当我搜索:object-a *时,我得到一个空结果。

我的字段的索引如下:

     <fieldType name="text_general" class="solr.TextField" positionIncrementGap="100">
        <analyzer type="index">
            <tokenizer class="solr.KeywordTokenizerFactory"/>
            <filter class="solr.WordDelimiterFilterFactory" 
                    splitOnNumerics="0" 
                    splitOnCaseChange="0"
                    preserveOriginal="1"/>
            <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
        <analyzer type="query">
            <tokenizer class="solr.KeywordTokenizerFactory"/>
            <filter class="solr.WordDelimiterFilterFactory" 
                    splitOnNumerics="0" 
                    splitOnCaseChange="0"
                    preserveOriginal="1"/>
            <filter class="solr.LowerCaseFilterFactory"/>
        </analyzer>
    </fieldType>

有什么想法吗?

谢谢!

2 个答案:

答案 0 :(得分:0)

尝试此属性,如下面链接所示。

catenateAll="1" causes all subword parts to be catenated: 

https://wiki.apache.org/solr/AnalyzersTokenizersTokenFilters

答案 1 :(得分:0)

When you use wildcards (*), you are hitting a little-known issue with Solr called multiterm. Specifically, WordDelimiterFilterFactory is not MultiTerm-aware (no (multi) flag marking it so on the Solr Start listing for the component) Wildcards are not very efficient, you may want to consider using EdgeNGram filter instead at the end of the chain.