数据config.xml如下
<dataConfig>
<dataSource type="JdbcDataSource" driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/solrdata" user="root" password="root" />
<document name="cars">
<entity name="car" query="SELECT color FROM solrdata.car ">
<field column="color" name="color" />
</entity>
</document>
</dataConfig>
schema.xml 如下所示
field name="color" type="string" indexed="true" stored="true" />
我在调试模式下检查了它正在获取数据但无法处理它
调试模式的输出如下:
{
"responseHeader": {
"status": 0,
"QTime": 312
},
"initArgs": [
"defaults",
[
"config",
"data-config.xml"
]
],
"command": "full-import",
"mode": "debug",
"documents": [
{
"COLOR": [
"red"
]
},
{
"COLOR": [
"silver"
]
},
{
"COLOR": [
"oii"
]
}
],
"verbose-output": [],
"status": "idle",
"importResponse": "",
"statusMessages": {
"Total Requests made to DataSource": "1",
"Total Rows Fetched": "3",
"Total Documents Skipped": "0",
"Full Dump Started": "2013-03-07 15:49:14",
"Total Documents Processed": "0",
"Total Documents Failed": "3",
"Time taken": "0:0:0.281"
},
"WARNING": "This response format is experimental. It is likely to change in the future."
}