I am trying to create a very simple search index on solr 4.5.1 with just two fields 'id' and 'name' by using a csv file. Running on Windows 8.
When I run:
curl http://localhost:8983/solr/update/csv --data-binary @mydata.csv -H
"Content-type:text/plain; charset=utf-8"
I get the error: Document is missing mandatory uniqueKey field: id
When I copy/paste the content of the file into the csv import function in the solr-admin ui (documents->document type:csv) then it works.
What am I missing? Thx for any help!
My 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>
The simplest csv file I tried is:
id,name
LXOxjksM2z, The simplest cookbook you can ever find