2017-07-05 22 views
2

查詢默認字段我對Solr的新人,和我有一個問題。當我做出這樣的查詢什麼對Solr中

<fieldType name="text_en" class="solr.TextField" positionIncrementGap="100"> 
<analyzer type="index"> 
    <tokenizer class="solr.StandardTokenizerFactory"/> 
    <filter class="solr.StopFilterFactory" words="lang/stopwords_en.txt" ignoreCase="true"/> 
    <filter class="solr.LowerCaseFilterFactory"/> 
    <filter class="solr.EnglishPossessiveFilterFactory"/> 
    <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> 
    <filter class="solr.PorterStemFilterFactory"/> 
</analyzer> 
<analyzer type="query"> 
    <tokenizer class="solr.StandardTokenizerFactory"/> 
    <filter class="solr.SynonymFilterFactory" expand="true" ignoreCase="true" synonyms="synonyms.txt"/> 
    <filter class="solr.StopFilterFactory" words="lang/stopwords_en.txt" ignoreCase="true"/> 
    <filter class="solr.LowerCaseFilterFactory"/> 
    <filter class="solr.EnglishPossessiveFilterFactory"/> 
    <filter class="solr.KeywordMarkerFilterFactory" protected="protwords.txt"/> 
    <filter class="solr.PorterStemFilterFactory"/> 
</analyzer> 

所以:在託管模式

每個字段類型定義,你可以同時指定索引分析和查詢分析器,像這樣的「Q:什麼」,如何我可以指定「東西」的字段,它的默認字段是什麼?

回答

2

你會發現在你request handler默認搜索領域,你需要檢查中的conf/solrconfig.xml中

檢查「DF」參數,

<str name="df">_text_</str> 

或者如果你想查詢特定如果你的查詢有多個標記,你可以指定它作爲,但不需要改變df值,

fieldname:"something1 something2" 
+0

我知道了。非常感謝。 – vincenteof