2

I am working on Solr. I can submit XML files but when i submit JSON, CSV or txt files: "Unsupported ContentType: application/octet-stream Not in: [application/xml, application/csv, application/json, text/json, text/csv, text/xml, application/javabin]"

Error: https://ibb.co/dcyV05

Do you have any suggestion ??

mfatihk
  • 136
  • 2
  • 11

2 Answers2

3

After you create core under documents there is a Request-Handler (qt) which is initially /update. If you change Document Type to File Upload you can't submit your json or csv files.

To solve this problem change Request-Handler (qt) to /update/extract. After that change there will be no error when you submit your files.

mfatihk
  • 136
  • 2
  • 11
0

yes, add the correct content type info to your POST, for example for json payload:

curl -X POST -H 'Content-Type: application/json' 
 'http://localhost:8983/solr/my_collection/update/json/docs' --data-binary '
{
  "id": "1",
  "title": "Doc 1"
}'
Persimmonium
  • 15,593
  • 11
  • 47
  • 78
  • use curl for testing, you will be able to set any and every param you need. Maybe the web app is not setting the right content type when uploading a file. – Persimmonium Jun 23 '17 at 11:55