solrのいくつかの小さな問題の記録(更新中)

1982 ワード

1.solrのschema.xmlプライマリ・キーの注意事項
solrのプライマリ・キーはstringタイプでなければなりません.
 
2.copyFiledとdefaultSearchFiledを併用、schema.xmlは次のように構成されています.
<fields>
<field name="id" type="string" indexed="true" stored="false" multiValued="true"/>
<field name="name" type="text" indexed="true" stored="false" multiValued="true"/>
<field name="address" type="text" indexed="true" stored="false" multiValued="true"/>
<field name="all" type="text" indexed="true" stored="false" multiValued="true"/>
</fields>

<copyField source="name" dest="all"/>
<copyField source="address" dest="all"/>

<defaultSearchField>all</defaultSearchField>


上記の構成では、allは実際のフィールドではありません.彼はnameとaddressフィールドのコピーです.allをデフォルトの検索フィールドに設定すると、デフォルトの検索時にnameとaddressで検索されます.
 
3.インデックスのすべてのインポート、インクリメンタルインポート、インデックス削除のコマンド
すべてインポート:
http://localhost:8080/genelist/dataimport?command=full-import&commit=true&charset=utf-8

インクリメンタルインポート:
http://localhost:8080/genelist/dataimport?command=delta-import&commit=true&charset=utf-8

idに従ってインデックスを削除するには、次の手順に従います.
http://localhost:8080/genelist/update/?stream.contentType=text/xml;charset=utf-8&commit=true&stream.body=<delete><id>123</id></delete>

クエリーに従ってインデックスを削除する:(すべてのインデックスを削除するなど)
http://localhost:8080/genelist/update/?stream.contentType=text/xml;charset=utf-8&commit=true&stream.body=<delete><query>*:*</query></delete>

以上のコマンドにはオプションやパラメータがたくさんあります.使用するときは自分で検索できます.