mysql - Solr 4.0 Delta-import 3 tables join -
i using solr 4.0 dih(jdbc connector) on ubuntu. trying create next mysql bring together query work solr on delta-import
:
select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id
here c, u, g aliases of tables customer
, user
, group
respectively.
below data-config.xml
file total , delta import:
<entity name="cust" pk="id" query="select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id" deltaimportquery="select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id c.id='${dih.delta.c.id}'" deltaquery="select id client last_modified > '${dih.last_index_time}'"> <entity name="grp" pk="dt_id" query="select * grouping dt_id='${cust.c.id}'" deltaquery="select dt_id grouping last_modified > '${dih.last_index_time}'" parentdeltaquery="select id client id=${grp.dt_id}" > <entity name="usr" pk="bus_grp_id" query="select * user" deltaquery="select bus_grp_id user last_modified > '${dih.last_index_time}'" parentdeltaquery="select dt_grp_id grouping dt_grp_id=${usr.bus_grp_id}" > </entity> </entity> </entity>
the full-import
ok delta-import
not working(i'm getting no results after delta import). it's been 1 month since i'm trying create work couldn't.
any help? please!
if query in main entity element i.e.
select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id
is giving fields need index in solr, don't think need other 2 sub-entities. guess there typo in deltaimportquery. should utilize dih.delta.id
, not dih.delta.c.id
.
i guess if maintain this, should work fine:
<entity name="cust" pk="id" query="select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id" deltaimportquery="select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id c.id='${dih.delta.id}'" deltaquery="select id client last_modified > '${dih.last_index_time}'" />
as total import, check file dataimport.properties. 1 time total import completes, create sure got documents in customer
table last_modified
greater time find in dataimport.properties delta has info run on. seek delta import , see if docs re-indexed. can find out how many got indexed delta import looking @ http://host:port/solr/core/dataimport
mysql join solr dih
No comments:
Post a Comment