我在 Ubuntu 上使用 Solr 4.0 DIH(JDBC 连接器)。我正在尝试使以下 MySQL JOIN 查询与 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
这里 c, u, g 分别是表和customer
的别名。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
不工作(增量导入后我没有得到任何结果)。自从我试图完成这项工作以来已经快一个月了,但做不到。
有什么帮助吗?请!