我想通過使用csv文件在solr 4.5.1上創建一個非常簡單的搜索索引,只有兩個字段'id'和'name'。運行在Windows 8在Windows上solr csv導入時文檔缺少強制uniqueKey字段
當我運行:
curl http://localhost:8983/solr/update/csv --data-binary @mydata.csv -H
"Content-type:text/plain; charset=utf-8"
我得到的錯誤:找不到文檔強制唯一鍵字段:ID
當我複製/粘貼文件的內容到CSV導入功能在solr-admin ui(文件 - >文件類型:csv)然後它工作。
我錯過了什麼? Thx任何幫助!
我的schema.xml:
我試過<fields>
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false" />
<!-- points to the root document of a block of nested documents -->
<field name="_root_" type="string" indexed="true" stored="false"/>
<field name="name" type="text_en" indexed="true" stored="true"/>
<field name="_version_" type="long" indexed="true" stored="true" multiValued="true"/>
</fields>
<uniqueKey>id</uniqueKey>
最簡單的CSV文件:
id,name
LXOxjksM2z, The simplest cookbook you can ever find
同時檢查csv文件是否有什麼奇怪的地方。你可以發佈你的CSV文件的地方,我可以下載並嘗試? – Arun