Solr添加SolrDocument报错

今天写了一个solr入库接口,使用了SolrServer.addBean接口,结果报错:Caused by: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Document is missing mandatory uniqueKey field: id。

经查solr使用手册,这是因为SolrDocument 没有id属性或者有id属性但是值为空。

随及解决问题。

posted @ 2014-04-14 10:00  李克华  阅读(1512)  评论(0编辑  收藏  举报