UbuntuでSolr4.0DIH(JDBCコネクタ)を使用しています。次のMySQLJOINクエリをSolrで機能させようとしていますDelta-import
:
select c.*,u.*,g.* from user u inner join group g on u.bus_grp_id = g.dt_grp_id inner join customer c on c.id = g.dt_id
customer
ここで、c、u、gは、それぞれテーブルのエイリアスuser
ですgroup
。
以下は、data-config.xml
フルインポートとデルタインポートのファイルです。
<entity name="cust" pk="id" query="select c.*,u.*,g.* from user u inner join group g on u.bus_grp_id = g.dt_grp_id inner join customer c on c.id = g.dt_id"
deltaImportQuery="select c.*,u.*,g.* from user u inner join group g on u.bus_grp_id = g.dt_grp_id inner join customer c on c.id = g.dt_id where c.id='${dih.delta.c.id}'"
deltaQuery="select id from customer where last_modified > '${dih.last_index_time}'">
<entity name="grp" pk="dt_id"
query="select * from group where dt_id='${cust.c.id}'"
deltaQuery="select dt_id from group where last_modified > '${dih.last_index_time}'"
parentDeltaQuery="select id from customer where id=${grp.dt_id}" >
<entity name="usr" pk="bus_grp_id"
query="select * from user"
deltaQuery="select bus_grp_id from user where last_modified > '${dih.last_index_time}'"
parentDeltaQuery="select dt_grp_id from group where dt_grp_id=${usr.bus_grp_id}" >
</entity>
</entity>
</entity>
これfull-import
は問題ありませんが、機能しDelta-import
ていません(デルタインポート後に結果が得られません)。私がこの仕事をしようとしてからほぼ1か月が経ちましたが、できませんでした。
何か助けはありますか?お願いします!