数据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