我在Apache SOLR中创建了一个DataImportHandler来从Cassandra数据库中检索数据。 我的配置如下
solrconfig.xml中:
<requestHandler name="/dataimport" class="org.apache.solr.handler.dataimport.DataImportHandler">
<lst name="defaults">
<str name="config">dataconfig.xml</str>
</lst>
</requestHandler>
dataconfig.xml:
<dataConfig>
<dataSource type="JdbcDataSource" driver="org.apache.cassandra.cql.jdbc.CassandraDriver"
url="jdbc:cassandra://192.92.12.2:9160/test"
user="user1"
password="passpass"
autoCommit="true"/>
<document name="content">
<entity name="test" query="SELECT id from test.contacts" autoCommit="true">
<field column="id" name="id" />
</entity>
</document>
</dataConfig>
schema.xml中:
<field name="id" type="string" indexed="true" stored="true" required="true" />
当我使用solr admin执行以下回复时
{ "responseHeader": { "status": 0, "QTime": 0 }, "initArgs": [ "defaults", [ "config", "dataconfig.xml" ] ], "command": "status", "status": "idle", "importResponse": "", "statusMessages": { "Time Elapsed": "0:12:6.182", "Total Requests made to DataSource": "0", "Total Rows Fetched": "0", "Total Documents Processed": "0", "Total Documents Skipped": "0", "Full Dump Started": "2016-09-05 10:52:52", "Full Import failed": "2016-09-05 10:52:52" } }
我无法确定此配置中的问题。