MySQLデータベースからSolr delta-importに問題があります。私は完全な輸入を問題なく行うことができます。デルタインポートを実行しようとすると、変更されたレコードが(期待通りに)インポートされますが、残りのインデックスは消去されるため、更新されたレコードのみがインデックスに格納されます。ログにエラーはありません。私の設定で何かが欠けていますか? UbuntuサーバーでSolr 5.4を実行し、管理UIを使用する。Solr delta-importはインデックスを消去します
<dataConfig>
<dataSource driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/ibnet" user="xxxx" password="xxxxx" />
<document>
<entity name="profile" pk="profile.id" query="
SELECT
profile.id AS id,
profile.profile_status AS profile_status,
//
// Other fields
//
linkedProfile.org_name AS linked_org_name,
linkedProfile.org_city AS linked_org_city,
linkedProfile.org_st_prov_reg AS linked_org_st_prov_reg,
linkedProfile.org_country AS linked_org_country
FROM profile AS profile
LEFT JOIN profile AS linkedProfile ON linkedProfile.id = profile.linked_id"
deltaImportQuery="
SELECT
profile.id AS id,
profile.profile_status AS profile_status,
//
// Other fields
//
linkedProfile.org_name AS linked_org_name,
linkedProfile.org_city AS linked_org_city,
linkedProfile.org_st_prov_reg AS linked_org_st_prov_reg,
linkedProfile.org_country AS linked_org_country
FROM profile AS profile
LEFT JOIN profile AS linkedProfile ON linkedProfile.id = profile.linked_id
WHERE profile.id = '${dih.delta.id}'"
deltaQuery="SELECT profile.id FROM profile WHERE last_modified > '${dih.last_index_time}'"
onError="skip" >
</entity>
</document>
編集:私はdataimporter.delta.idするdih.delta.id変更と同じlast_index_timeのために、それは結果を変更されていませんしました。ここで
は応答である:Solrの管理者で
{
"responseHeader": {
"status": 0,
"QTime": 0
},
"initArgs": [
"defaults",
[
"config",
"data-config.xml"
]
],
"command": "status",
"status": "idle",
"importResponse": "",
"statusMessages": {
"Total Requests made to DataSource": "4",
"Total Rows Fetched": "6",
"Total Documents Processed": "3",
"Total Documents Skipped": "0",
"Delta Dump started": "2016-05-01 02:38:03",
"Identifying Delta": "2016-05-01 02:38:03",
"Deltas Obtained": "2016-05-01 02:38:03",
"Building documents": "2016-05-01 02:38:03",
"Total Changed Documents": "3",
"": "Indexing completed. Added/Updated: 3 documents. Deleted 0 documents.",
"Committed": "2016-05-01 02:38:03",
"Time taken": "0:0:0.317"
}
}
solr adminの最初のオプションを確認しましたか? –
そして、xmlの特殊文字なので、sqlの '>'を '>'に変更してください。 –
明確なオプションはどこですか?私は>に変更し、 'processor =" SqlEntityProcessor "'も追加しました。 – SM0827