我正在使用Solr 5.2,我有一個網站,內容較大(雙語),需要索引搜索功能,我需要索引一些元數據有關每個內容(類別,標題,日期,...),並且我還需要根據您的知識和經驗爲網頁的內容編制索引,將單個字段中的所有字段複製並使用此字段進行搜索是正確的,我現在正在執行以下操作Solr大型內容網站
<fieldType name="compound_text" class="solr.TextField" positionIncrementGap="100" multiValued="true">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.StopFilterFactory" words="lang/stopwords_en.txt" ignoreCase="true"/>
<filter class="solr.StopFilterFactory" words="lang/stopwords_ar.txt" ignoreCase="true"/>
<filter class="solr.ArabicNormalizationFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<field name="compound_text_field" type="compound_text" multiValued="true" indexed="true" stored="true"/>
<field name="author_name" type="strings" indexed="false" stored="false"/>
<field name="category" type="strings" indexed="false" stored="true"/>
<field name="content_ar" type="strings" indexed="false" stored="true"/>
<field name="content_en" type="strings" indexed="false" stored="true"/>
<field name="content_title" type="compound_text" indexed="true" stored="true" multiValued="true"/>
<field name="publish_date" type="tdate"/>
<copyField source="content_ar" dest="compound_text_field"/>
<copyField source="content_en" dest="compound_text_field"/>
<copyField source="content_title" dest="compound_text_field"/>
<copyField source="source" dest="compound_text_field"/>
<copyField source="category" dest="compound_text_field"/>
<copyField source="author_name" dest="compound_text_field"/>
<fieldType name="text_suggest" class="solr.TextField" positionIncrementGap="100">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.ArabicNormalizationFilterFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
<field name="text_suggest_field" type="text_suggest" indexed="true" stored="true"/>
<copyField source="content_title" dest="text_suggest_field>
如果您更好地使用多種語言,可以爲每種語言使用不同的索引,或者在一種索引中使用不同語言的不同字段。在這裏,您正在將content_en(英文字段)複製到具有arabicfilterfactory的單個字段。 – vinod