You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Steve Rowe (JIRA)" <ji...@apache.org> on 2014/07/29 20:50:39 UTC

[jira] [Comment Edited] (SOLR-6294) The JsonLoader should accept a single doc without wrapping in an array

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

Steve Rowe edited comment on SOLR-6294 at 7/29/14 6:49 PM:
-----------------------------------------------------------

"add", "commit" and "optimize" expect as their value an array of objects or an object.

"delete" can take a scalar id, or an array of id scalars, or an object with a query or "id"+id scalar and optional params (whew).

"rollback" takes no value (I think this may be a parsing bug - does JSON accept a value-less key?)

By contrast, a document (with the exception of nested docs) will always have flat "key":value structure. 

So with the exception of "delete", I think it should possible to detect commands versus fields based exclusively on value types.  Maybe just have a documented exception that "delete" field names are disallowed in single document mode?


was (Author: steve_rowe):
"add", "commit" and "optimize" expect as their value an array of objects or an object.

"delete" can take a scalar id, or an array of id scalars, or an object with a query or "id"+id scalar and optional params (whew).

"rollback" takes no value (I think this may be a parsing bug - does JSON accept a value-less key).

By contrast, a document (with the exception of nested docs) will always have flat "key":value structure. 

So with the exception of "delete", I think it should possible to detect commands versus fields based exclusively on value types.  Maybe just have a documented exception that "delete" field names are disallowed in single document mode?

> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org