數據config.xml的是如下Solr的數據導入處理程序無法索引數據
<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中是follsws
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."
}
你在你的schema.xml中有一個「唯一鍵」字段?你如何爲每個被索引的文檔構造它? – Mavellin 2013-03-07 11:12:05
我是solr的新手,我在現有的schema.xml中添加了這個字段。 – 2013-03-07 11:17:49