Document is missing mandatory uniqueKey field: id

Caused by: org.apache.solr.client.solrj.impl.HttpSolrServer$RemoteSolrException: Document is missing mandatory uniqueKey field: id

一、managed-schema文件定義了ID爲必須存在的字段,如果你的配置文件有設置,那需要給存儲實體定義字段ID;要不就把配置文件的定義修改掉
二、如果不是第一種情況,那估計和我一樣,多次檢查後,發現並不存在第一種情況,是方法名寫錯了,把solrTemplate.saveBeans(list)寫成了solrTemplate.saveBean(list);
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章