On 24 August 2012 07:17, Hasan Diwan <hasan.di...@gmail.com> wrote: > I have some data in an H2 database that I'd like to move to SOLR. I > probably should/could extract and post the contents as 1 new document per > record, but I'd like to configure the data import handler and am having > some difficulty doing so. Following the wiki instructions[1], I have the > following in my db-data-config.xml: > <dataConfig> > <dataSource type="JdbcDataSource" driver="org.h2.Driver" > url="jdbc:h2:tcp://192.168.1.6/finance" user="sa" /> > <document> > <entity name="receipt" query="select location as location, amount as > amount, done_on as when from RECEIPTS as r join APP_USERS as a on r.user_id > = a.id"/> > </document> > </dataConfig> > > I also have dropped the JDBC driver into db/lib, witness: > % jar tvf ./lib/h2-1.3.164.jar | grep 'Driver' > 13 Fri Feb 03 12:02:56 PST 2012 META-INF/services/java.sql.Driver > 2508 Fri Feb 03 12:02:56 PST 2012 org/h2/Driver.class > 485 Fri Feb 03 12:02:56 PST 2012 org/h2/util/DbDriverActivator.class > > and I've added the appropriate fields to schema.xml: > <field name="location" type="string" indexed="true" stored="true"/> > <field name="amount" type="currency" indexed="true" stored="true"/> > <field name="when" type="date" indexed="true" stored="true"/> > > There's nothing in my index and 343 rows in my table. What is going on? -- > H >
One more data point: % curl -L "http://localhost:8983/solr/db/dataimport?command=status" <?xml version="1.0" encoding="UTF-8"?> <response> <lst name="responseHeader"><int name="status">0</int><int name="QTime">0</int></lst><lst name="initArgs"><lst name="defaults"><str name="config">db-data-config.xml</str></lst></lst><str name="command">status</str><str name="status">idle</str><str name="importResponse"/><lst name="statusMessages"><str name="Total Requests made to DataSource">1</str><str name="Total Rows Fetched">343</str><str name="Total Documents Skipped">0</str><str name="Full Dump Started">2012-08-24 07:19:26</str><str name="">Indexing completed. Added/Updated: 0 documents. Deleted 0 documents.</str><str name="Committed">2012-08-24 07:19:26</str><str name="Optimized">2012-08-24 07:19:26</str><str name="Total Documents Processed">0</str><str name="Time taken ">0:0:0.328</str></lst><str name="WARNING">This response format is experimental. It is likely to change in the future.</str> </response> -- Sent from my mobile device Envoyait de mon portable