[ 
https://issues.apache.org/jira/browse/SOLR-6294?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14078137#comment-14078137
 ] 

Timothy Potter commented on SOLR-6294:
--------------------------------------

Maybe we just leave it as-is (require the wrapping [ ]) and improve the error 
message as right now, this is what you get back from Solr when you add a single 
JSON document:

curl http://localhost:8983/solr/gettingstarted/update?commit=true -X POST -H 
'Content-Type: application/json' \
 -d '{
"id":"foo",
"POST_ID":"354-20160",
...
}'

{"responseHeader":{"status":400,"QTime":0},"error":{"msg":"Unknown command: id 
[6]","code":400}}

So at the very least, we need to give the user an idea of how to move forward 
w/o having to post to the mailing list or search the docs.

> The JsonLoader should accept a single doc without wrapping in an array
> ----------------------------------------------------------------------
>
>                 Key: SOLR-6294
>                 URL: https://issues.apache.org/jira/browse/SOLR-6294
>             Project: Solr
>          Issue Type: Bug
>          Components: update
>            Reporter: Noble Paul
>            Assignee: Noble Paul
>            Priority: Minor
>
> This is the multi document input command
> {noformat}
> curl http://localhost:8983/solr/update/json -H 
> 'Content-type:application/json' -d '
> [
>  {"id" : "TestDoc1", "title" : "test1"},
> ]'
> {noformat}
> The following also should be a valid update command for a single doc
> {noformat}
> curl http://localhost:8983/solr/update/json -H 
> 'Content-type:application/json' -d '
>  {"id" : "TestDoc1", "title" : "test1"},
> '
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to