I have a simple test database for my first attempt to index database data using SOLR DIH. Unfortunately, I get the following result from a full import every time:
<response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">15</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="status">idle</str> <str name="importResponse"/> <lst name="statusMessages"> <str name="Time Elapsed">0:0:2.187</str> <str name="Total Requests made to DataSource">1</str> <str name="Total Rows Fetched">0</str> <str name="Total Documents Processed">0</str> <str name="Total Documents Skipped">0</str> <str name="Full Dump Started">2011-03-06 21:30:07</str> <str name="">Indexing failed. Rolled back all changes.</str> <str name="Rolledback">2011-03-06 21:30:07</str> </lst> <str name="WARNING"> This response format is experimental. It is likely to change in the future. </str> </response>
In my solrconfig.xml file, the following requestHandler is specified:
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler"> <lst name="defaults"> <str name="config">data-config.xml</str> </lst> </requestHandler>
my data-config.xml contains the following:
<dataConfig> <dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:8889/Dev1" user="root" password="***"/> <document> <entity name="business_profile" query="select business_id,business_name,address1,address2,city,state,zip from business_profile"> </entity> </document> </dataConfig>
schema.xml scope definition:
<field name="business_id" type="int" indexed="true" stored="true"/> <field name="business_name" type="string" indexed="true" stored="true"/> <field name="address1" type="string" indexed="true" stored="true"/> <field name="address2" type="string" indexed="true" stored="true"/> <field name="city" type="string" indexed="true" stored="true"/> <field name="state" type="string" indexed="true" stored="true"/> <field name="zip" type="string" indexed="true" stored="true"/>
If general queries to the data source display β1β, does this mean that the JDBC driver is configured correctly, and is this a possible problem with MySQL permissions at this point or not?
I played with the DIH dev console trying to return something, but always 1 query and 0 rows, which makes me think about JDBC or mySQL permissions. I excluded the DB name, port #, and user / pass, but maybe the JDBC driver is not installed correctly.?
thanks
This is what I get from solr magazine
0:0:0:0:0:0:0:1%0 - - [07/03/2011:17:50:41 +0000] "GET /solr/dataimport?command=full-import&mode=debug HTTP/1.1" 200 853 0:0:0:0:0:0:0:1%0 - - [07/03/2011:17:50:47 +0000] "GET /solr/dataimport?command=full-import&mode=debug HTTP/1.1" 200 851 0:0:0:0:0:0:0:1%0 - - [07/03/2011:17:51:03 +0000] "GET /solr/dataimport?command=full-import&mode=debug HTTP/1.1" 200 853 0:0:0:0:0:0:0:1%0 - - [07/03/2011:17:51:13 +0000] "GET /solr/dataimport?command=full-import&mode=debug HTTP/1.1" 200 852 0:0:0:0:0:0:0:1%0 - - [07/03/2011:17:51:14 +0000] "GET /solr/dataimport?command=full-import&mode=debug HTTP/1.1" 200 852