我使用Solr的4開始,我已經到位的Solr沒有找到記錄,如果查詢字符串短字
<filter class="solr.LengthFilterFactory" min="3" max="99"/>
長度濾清器廠如果我的查詢字符串使用具有少於3個字符的單詞開始,solr不會返回任何結果。我並不期待這會成爲問題,因爲我正在使用LengthFilterFactory。下面是例子:
的標題是: 「在不遠的未來...」
如果我搜索q:In the close future
,Solr的返回任何
如果我搜索q:the close future
,Solr的發現記錄
標題是:「我有一些solr問題」 同樣發生在上面...
我不能允許單詞短於3 c需要搜索的字符,但我沒有想到,如果我使用短於3個字符的單詞,它會導致solr失敗。也許LengthFilterFactory在這裏不是問題?
這裏是我的查詢示例:
INFO: [collection1] webapp=/solr-example path=/select params={mm=100%25&json.nl=flat&fl=id&start=0&sort=date_0_i+desc,hour_0_i+desc&fq=type_s:(1+5+6+8+9+10)&fq=site_i:1&fq=terms_txt:I+have+some+solr+problem&fq=date_in_i:[20050101+TO+*]&fq=date_in_i:[*+TO+20171012]&fq=language_is:0&rows=10&bq=&q=I+have+some+solr+problem&tie=0.1&defType=edismax&omitHeader=true&qf=terms_txt&wt=json} hits=0 status=0 QTime=1
這裏是我的架構波紋管。我將向您展示我正在搜索的字段的字段定義。任何人都知道這裏有什麼問題嗎?
<fieldType name="text_general_example" class="solr.TextField" positionIncrementGap="100">
<analyzer type="index">
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-FoldToASCII.txt"/>
<charFilter class="solr.HTMLStripCharFilterFactory"/>
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="(^|\s)([^\-\_&\s]+([\-\_&]+[^\-\_&\s]*)+)(?=(\s|$))" replacement="$1MжџљМ$2 $2" />
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\bMжџљМ([^\s]*?)\b[\-_&]+" replacement="MжџљМ$1" />
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\bMжџљМ([^\s]*?)\b[\-_&]+" replacement="MжџљМ$1" />
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\bMжџљМ([^\s]*?)\b[\-_&]+" replacement="MжџљМ$1" />
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="MжџљМ" replacement="" />
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="(\w)&(\w)" replacement="$1and$2" />
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LengthFilterFactory" min="3" max="99"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
<analyzer type="query">
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="\b[\-_]+\b" replacement="" />
<charFilter class="solr.MappingCharFilterFactory" mapping="mapping-FoldToASCII.txt"/>
<charFilter class="solr.PatternReplaceCharFilterFactory" pattern="(\w)&(\w)" replacement="$1and$2" />
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LengthFilterFactory" min="3" max="99"/>
<filter class="solr.StopFilterFactory" ignoreCase="true" words="stopwords.txt" enablePositionIncrements="true" />
<filter class="solr.SynonymFilterFactory" synonyms="synonyms.txt" ignoreCase="true" expand="true"/>
<filter class="solr.LowerCaseFilterFactory"/>
<filter class="solr.RemoveDuplicatesTokenFilterFactory" />
</analyzer>
</fieldType>
它正是你正在使用的查詢嗎?你不在查詢中使用任何字段? – Mysterion
@Mysterion我已將我的查詢示例添加到帖子中。 – offline