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
--
Sent from my mobile device
Envoyait de mon portable
1. http://wiki.apache.org/solr/DIHQuickStart