我已配置solrindex-mapping.xml
(nutch)并配置了我的solr schema.xml
和solrconfig.xml
。两者都在单次运行时运行良好,但如果我使用bin/nutch solrindex ...
,我会得到一个例外:
org.apache.solr.common.SolrException: Document [null] missing required field: id
我在所有配置文件中配置了id
。在solrindex-mapping.xml
,它从url
映射到id
,在schema.xml
solr我也配置了ID。我不知道出了什么问题。我将一些日志记录输出添加到org.apache.nutch.indexer.solr.SolrWriter.java
。当读取字段添加到SolrInputDocument时,我在这些行添加一个loginfo。构建和运行后的结果是:
2010-09-11 21:31:06,326 INFO solr.SolrWriter - write()
2010-09-11 21:31:06,327 INFO solr.SolrWriter - Key: segment, value: 20100911212934
2010-09-11 21:31:06,327 INFO solr.SolrWriter - Key: boost, value: 1.0
2010-09-11 21:31:06,327 INFO solr.SolrWriter - Key: digest, value: bc315927b7c01c7a2905d5b6872bc35b
2010-09-11 21:31:06,327 INFO solr.SolrWriter - close()
您将只看到3个读取字段O_o。有谁知道我的配置是否有问题? 我需要快速运行的nutch,因为我目前正在写我的学士论文:/ (关于本地网络异构数据源的信息集成)
最好的问候 marcel =)
日志的其余部分:
2010-09-11 21:31:06,079 INFO solr.SolrWriter - open()
2010-09-11 21:31:06,280 INFO solr.SolrMappingReader - source: content dest: content
2010-09-11 21:31:06,280 INFO solr.SolrMappingReader - source: site dest: site
2010-09-11 21:31:06,280 INFO solr.SolrMappingReader - source: title dest: metadata_title
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: host dest: host
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: segment dest: segment
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: boost dest: boost
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: digest dest: digest
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: tstamp dest: metadata_last_modified
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: lastModified dest: metadata_last_modified
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: url dest: url
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: url dest: id
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: url dest: id
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - source: url dest: url
2010-09-11 21:31:06,281 INFO solr.SolrMappingReader - uniqueKey = id
2010-09-11 21:31:06,291 INFO solr.SolrWriter - write()
2010-09-11 21:31:06,294 INFO solr.SolrWriter - Key: segment, value: 20100911212934
2010-09-11 21:31:06,294 INFO solr.SolrWriter - Key: boost, value: 1.0
2010-09-11 21:31:06,294 INFO solr.SolrWriter - Key: digest, value: 18abadd34a2bd71a8336fa5e8c6dbedb
2010-09-11 21:31:06,306 INFO solr.SolrWriter - write()
2010-09-11 21:31:06,306 INFO solr.SolrWriter - Key: segment, value: 20100911212934
2010-09-11 21:31:06,306 INFO solr.SolrWriter - Key: boost, value: 1.0
2010-09-11 21:31:06,306 INFO solr.SolrWriter - Key: digest, value: 3267fd5ea03852cdc83383635d133fad
2010-09-11 21:31:06,310 INFO solr.SolrWriter - write()
2010-09-11 21:31:06,310 INFO solr.SolrWriter - Key: segment, value: 20100911212934
2010-09-11 21:31:06,310 INFO solr.SolrWriter - Key: boost, value: 1.0
2010-09-11 21:31:06,311 INFO solr.SolrWriter - Key: digest, value: b61607602ab99eda5684adc9966349d6
2010-09-11 21:31:06,314 INFO solr.SolrWriter - write()
2010-09-11 21:31:06,314 INFO solr.SolrWriter - Key: segment, value: 20100911212851
2010-09-11 21:31:06,314 INFO solr.SolrWriter - Key: boost, value: 1.0
2010-09-11 21:31:06,314 INFO solr.SolrWriter - Key: digest, value: 9bdb8df3d1addf254203542dd22096d3
2010-09-11 21:31:06,316 INFO solr.SolrWriter - write()
2010-09-11 21:31:06,316 INFO solr.SolrWriter - Key: segment, value: 20100911212934
2010-09-11 21:31:06,316 INFO solr.SolrWriter - Key: boost, value: 1.0
2010-09-11 21:31:06,317 INFO solr.SolrWriter - Key: digest, value: 66eb3639ae15655bf91dc53208f95167
2010-09-11 21:31:06,319 INFO solr.SolrWriter - write()
2010-09-11 21:31:06,319 INFO solr.SolrWriter - Key: segment, value: 20100911212934
2010-09-11 21:31:06,319 INFO solr.SolrWriter - Key: boost, value: 1.0
2010-09-11 21:31:06,319 INFO solr.SolrWriter - Key: digest, value: 6e0501b52e204c2a68d9caa70dd0dfa9
2010-09-11 21:31:06,326 INFO solr.SolrWriter - write()
2010-09-11 21:31:06,327 INFO solr.SolrWriter - Key: segment, value: 20100911212934
2010-09-11 21:31:06,327 INFO solr.SolrWriter - Key: boost, value: 1.0
2010-09-11 21:31:06,327 INFO solr.SolrWriter - Key: digest, value: bc315927b7c01c7a2905d5b6872bc35b
2010-09-11 21:31:06,327 INFO solr.SolrWriter - close()
2010-09-11 21:31:06,687 WARN mapred.LocalJobRunner - job_local_0001
org.apache.solr.common.SolrException: Document [null] missing required field: id
Document [null] missing required field: id
request: http://127.0.0.1:8983/solr/update?wt=javabin&version=1
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:424)
at org.apache.solr.client.solrj.impl.CommonsHttpSolrServer.request(CommonsHttpSolrServer.java:243)
at org.apache.solr.client.solrj.request.AbstractUpdateRequest.process(AbstractUpdateRequest.java:105)
at org.apache.solr.client.solrj.SolrServer.add(SolrServer.java:49)
at org.apache.nutch.indexer.solr.SolrWriter.close(SolrWriter.java:98)
at org.apache.nutch.indexer.IndexerOutputFormat$1.close(IndexerOutputFormat.java:48)
at org.apache.hadoop.mapred.ReduceTask.runOldReducer(ReduceTask.java:474)
at org.apache.hadoop.mapred.ReduceTask.run(ReduceTask.java:411)
at org.apache.hadoop.mapred.LocalJobRunner$Job.run(LocalJobRunner.java:216)
2010-09-11 21:31:07,556 ERROR solr.SolrIndexer - java.io.IOException: Job failed!
答案 0 :(得分:0)
Nutch 1.2不适用于Solr主干...
来自Nutch邮件列表(原始帖子here)...
大家都知道1.2是否适用于当前的Solr主干?
它没有,它使用Solr 1.4.x. Solr trunk使用不兼容的API。