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属性但是值为空。

随及解决问题。

原文地址:https://www.cnblogs.com/likehua/p/3663374.html