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

Varun Thacker commented on SOLR-6294:
-------------------------------------

Currently this is the behaviour -

Request:
{noformat}
curl http://localhost:8983/solr/update/json?commit=true -d '
[
 {"id" : "1", "title" : "test"}
]'
{noformat}

Response:
{noformat}
<?xml version="1.0" encoding="UTF-8"?>
<response>
<lst name="responseHeader"><int name="status">0</int><int 
name="QTime">1</int></lst>
</response>
{noformat}

No document gets added. Confused as to why the response gave a status=0 and did 
not add the document.


But adding the content header type leads to document add - 

{noformat}
curl http://localhost:8983/solr/update/json?commit=true -H 
'Content-type:application/json' -d '
[
 {"id" : "1", "title" : "test"}
]'
{noformat}


So the content type header gets respected currently.

> 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