After setting Solr DataImportHandler up and trying to fetch data from SQL Server via the HTTP API (http://localhost:8080/solr/dataimport?command=full-import) I got an error response back, telling all changes had been rolled back.
[code]
<response>
<lst name="responseHeader">
<int name="status">0</int>
<int name="QTime">7</int>
</lst>
<lst name="initArgs">
</lst><lst name="defaults">
<str name="config">data-config.xml</str>
</lst>
<str name="command">full-import</str>
<str name="status">idle</str>
<str name="importResponse"></str>
<lst name="statusMessages">
<str name="Time Elapsed">0:1:19.495</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">2013-08-14 11:20:59</str>
<str name="">Indexing failed. Rolled back all changes.</str>
<str name="Rolledback">2013-08-14 11:21:28</str>
</lst>
<str name="WARNING">
This response format is experimental. It is likely to change in the future.
</str>
</response>
[/code]
The Catalina log didn’t tell me anything useful, but checking “Logging” in http://localhost:8080/solr/ threw:
[code]
WARN SimplePropertiesWriter Unable to read: dataimport.properties
[/code]
It simply says that Solr is unable to read the file dataimport.properties.
The file is not a part of the standard Solr package and is not created automatically.
To fix this warning, simply created an empty file called “dataimport.properties” in your Solr conf directory, eg. /Solr/collection1/conf/ and make sure Apache has write access to it.