2016-08-28 4 views
0

私はSolr 5.2を使用していますが、検索機能にインデックスを付ける必要がある大量のコンテンツ(2カ国語)を持つウェブサイトを持っています。各コンテンツ(カテゴリ、タイトル、日付、..)また、あなたの知識と経験に基づいて、ウェブページのコンテンツを索引付けする必要があります.1つのフィールドにすべてのフィールドをコピーして、このフィールドを検索に使用するのは正しいですか?Solr大容量のWebサイトを指しています

<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> 
+0

複数の言語を使用している場合は、言語ごとに異なるインデックスを使用するか、1つのインデックスで言語ごとに異なるフィールドを使用する方がよい場合。ここでは、content_en(英語のフィールド)をアラビア語のフレーズを持つ単一のフィールドにコピーしています。 – vinod

答えて

0

...そう、あなたのアプリケーションに適していただきました!を参照してくださいするにはいくつかの方法があります...

  1. conf/schema.xmlに新しいフィールドを追加します。これは、検索したいすべてのフィールドの連結のように機能します。フィールドをxmlファイルのdefaultSearchFieldとして設定し、フィールド名なしでクエリを送信します。 copyFieldを使用して値を連結フィールドにコピーすることができます。

  2. 異なるクエリ文字列を使用して、スペースで区切られた "field:query"のペアとして含めることができます。

完全にユースケースに依存します。

+0

数字1は私が取ったアプローチです。私のスキーマのcompound_text_fieldを参照してください。しかし、アラビア語のコンテンツと英語のコンテンツを同じフィールドに追加するのは正しいですか? – Moon123

関連する問題