I'm trying to use DataImportHandler to load my index and having some strange results. I have two tables in my database. DPRODUC contains products and FSKUMAS contains the skus related to each product.
This is the data-config I'm using. <dataConfig> <dataSource type="JdbcDataSource" driver="com.ibm.as400.access.AS400JDBCDriver" url="jdbc:as400:IWAVE;prompt=false;naming=system" user="IPGUI" password="IPGUI"/> <document> <entity name="dproduc" query="select dprprd, dprdes from dproduc where dprprd like 'F%'"> <field column="dprprd" name="id" /> <field column="dprdes" name="name" /> <entity name="fskumas" query="select fsksku, fcoclr, fszsiz, fskret from fskumas where dprprd='${dproduc.DPRPRD}'"> <field column="fsksku" name="sku" /> <field column="fcoclr" name="color" /> <field column="fszsiz" name="size" /> <field column="fskret" name="price" /> </entity> </entity> </document> </dataConfig> and this is the relevant part of my schema.xml <field name="id" type="string" indexed="true" stored="true" required="true" /> <field name="name" type="textgen" indexed="true" stored="true"/> <field name="sku" multiValued="true" type="textTight" indexed="true" stored="true" omitNorms="true"/> <field name="color" multiValued="true" type="textgen" indexed="true" stored="true"/> <field name="size" multiValued="true" type="textgen" indexed="true" stored="true"/> <field name="price" multiValued="true" type="float" indexed="true" stored="true"/> The queries appear to be executing correctly. Here is what the DIH console shows when I debug it for the first two products. But notice that the nested query on fskumas shows up twice on the second product. That continues the more products I include; 3 for the 3rd product, 4 for the fourth, etc. And also notice that zero documents end up being processed. Can anyone spot what I'm doing wrong? <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">656</int> </lst> <lst name="initArgs"> <lst name="defaults"> <str name="config">data-config.xml</str> </lst> </lst> <str name="command">full-import</str> <str name="mode">debug</str> <null name="documents" /> <lst name="verbose-output"> <lst name="entity:dproduc"> <lst name="document#1"> <str name="query">select dprprd, dprdes from dproduc where dprprd like 'F%'</str> <str name="time-taken">0:0:0.313</str> <str>----------- row #1-------------</str> <str name="DPRDES">ADIRON/CEDAR/SEAT </str> <str name="DPRPRD">F001 </str> <str>---------------------------------------------</str> <lst name="entity:fskumas"> <str name="query">select fsksku, fcoclr, fszsiz, fskret from fskumas where dprprd='F001 '</str> <str name="time-taken">0:0:0.313</str> <str>----------- row #1-------------</str> <str name="FSZSIZ" /> <str name="FSKSKU">java.math.BigDecimal:100032</str> <str name="FSKRET">java.math.BigDecimal:0.01</str> <str name="FCOCLR" /> <str>---------------------------------------------</str> </lst> </ lst> <lst name="document#1"> <str>----------- row #1-------------</str> <str name="DPRDES">ADIRON/CEDAR/BACK </str> <str name="DPRPRD">F002 </str> <str>---------------------------------------------</str> <lst name="entity:fskumas"> <str name="query">select fsksku, fcoclr, fszsiz, fskret from fskumas where dprprd='F002 '</str> <str name="query">select fsksku, fcoclr, fszsiz, fskret from fskumas where dprprd='F002 '</str> <str name="time-taken">0:0:0.15</str> <str name="time-taken">0:0:0.15</str> <str>----------- row #1-------------</str> <str name="FSZSIZ" /> <str name="FSKSKU">java.math.BigDecimal:100040</str> <str name="FSKRET">java.math.BigDecimal:0.01</str> <str name="FCOCLR" /> <str>---------------------------------------------</str> </lst> </ lst> <lst name="document#1" /> </lst> </lst> <str name="status">idle</str> <str name="importResponse">Configuration Re-loaded sucessfully</str> <lst name="statusMessages"> <str name="Total Requests made to DataSource">3</str> <str name="Total Rows Fetched">4</str> <str name="Total Documents Skipped">0</str> <str name="Full Dump Started">2009-12-26 21:46:45</str> <str name="Total Documents Processed">0</str> <str name="Time taken ">0:0:0.656</str> </lst> <str name="WARNING">This response format is experimental. It is likely to change in the future.</str> </lst> </lst> </response>