开发者

Solr dataimport skips entities in my data-config.xml

My data-config.xml defines 3 different entities under the document tag (lets call them foo, bar and baz). When I issue a basic full import localhost:8983/solr/dataimport?command=full-import, only 2 of the 3 entities get indexed (foo and bar are in my index but baz never makes it). However, if I then issue a command to just import baz via localhost:8983/solr/dataimport?command=full-import&entity=baz&clean=false it adds baz documents just fine and the index then has all 3 types.

Does anyone have any thoughts on why one entity gets skipped in the general data import but then still works okay if I specifically call it out? I开发者_如何学编程s there an error/warning log I can check? Nothing bad shows up in /solr/logs/ but those just appear to be request logs.


Okay, I figured out what was happening. Each entity in my data-config.xml had a field called "id" but I also had <uniqueKey>id</uniqueKey> set in schema.xml. So solr documents for baz were getting overwritten by documents from foo because they both had the same numeric id. I switched my schema.xml so that each entity had a completely unique id, problem solved.


The file data-config.xml will not be valid XML. Check it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜