[jira] [Updated] (SOLR-3887) Add support for arrays of operations to JSON Update Handler
[ https://issues.apache.org/jira/browse/SOLR-3887?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jesse Dubay updated SOLR-3887: -- Attachment: SOLR-3887.patch > Add support for arrays of operations to JSON Update Handler > --- > > Key: SOLR-3887 > URL: https://issues.apache.org/jira/browse/SOLR-3887 > Project: Solr > Issue Type: Improvement > Components: update >Affects Versions: 4.0-BETA >Reporter: Jesse Dubay >Priority: Minor > Labels: json, update > Fix For: 4.0 > > Attachments: SOLR-3887.patch > > > Currently, UpdateRequestHandler accepts a sequence of operations in JSON > format by specifying duplicate keys. While duplicate keys aren't forbidden by > the JSON spec, in practice, this makes the update handler difficult to use in > conjunction with JSON serialization libraries in clients. > This has been mitigated somewhat by adding special syntax to add and delete > in SOLR-2496 and SOLR-3508 respectively, but there's still no way to specify > operations in a particular sequence as you can with XML. Per the JSON spec, > the right way to do this is with an array, as objects are considered > unordered sets. > Using an array at the top level would obviate the need for such a key, but > that syntax was used in the fix for SOLR-2496 as a shortcut for adds, so... > The attached patch adds an "operations" key that can exist at the same level > as any other operation. The "operations" key's value is an array of objects, > each of which uses the same syntax as the root object: > {code} > { > "operations": [ > {"add": {"id": "1"}}, > {"delete": {"query": "foo"}}, > {"add": {"id": "2"}}, > {"commit": {}}, > ] > } > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Created] (SOLR-3887) Add support for arrays of operations to JSON Update Handler
Jesse Dubay created SOLR-3887: - Summary: Add support for arrays of operations to JSON Update Handler Key: SOLR-3887 URL: https://issues.apache.org/jira/browse/SOLR-3887 Project: Solr Issue Type: Improvement Components: update Affects Versions: 4.0-BETA Reporter: Jesse Dubay Priority: Minor Fix For: 4.0 Attachments: SOLR-3887.patch Currently, UpdateRequestHandler accepts a sequence of operations in JSON format by specifying duplicate keys. While duplicate keys aren't forbidden by the JSON spec, in practice, this makes the update handler difficult to use in conjunction with JSON serialization libraries in clients. This has been mitigated somewhat by adding special syntax to add and delete in SOLR-2496 and SOLR-3508 respectively, but there's still no way to specify operations in a particular sequence as you can with XML. Per the JSON spec, the right way to do this is with an array, as objects are considered unordered sets. Using an array at the top level would obviate the need for such a key, but that syntax was used in the fix for SOLR-2496 as a shortcut for adds, so... The attached patch adds an "operations" key that can exist at the same level as any other operation. The "operations" key's value is an array of objects, each of which uses the same syntax as the root object: {code} { "operations": [ {"add": {"id": "1"}}, {"delete": {"query": "foo"}}, {"add": {"id": "2"}}, {"commit": {}}, ] } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (SOLR-3887) Add support for arrays of operations to JSON Update Handler
[ https://issues.apache.org/jira/browse/SOLR-3887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13462924#comment-13462924 ] Jesse Dubay commented on SOLR-3887: --- Hoss, no problem. Thanks for taking a look at it! > Add support for arrays of operations to JSON Update Handler > --- > > Key: SOLR-3887 > URL: https://issues.apache.org/jira/browse/SOLR-3887 > Project: Solr > Issue Type: Improvement > Components: update >Affects Versions: 4.0-BETA >Reporter: Jesse Dubay >Priority: Minor > Labels: json, update > Attachments: SOLR-3887.patch > > > Currently, UpdateRequestHandler accepts a sequence of operations in JSON > format by specifying duplicate keys. While duplicate keys aren't forbidden by > the JSON spec, in practice, this makes the update handler difficult to use in > conjunction with JSON serialization libraries in clients. > This has been mitigated somewhat by adding special syntax to add and delete > in SOLR-2496 and SOLR-3508 respectively, but there's still no way to specify > operations in a particular sequence as you can with XML. Per the JSON spec, > the right way to do this is with an array, as objects are considered > unordered sets. > Using an array at the top level would obviate the need for such a key, but > that syntax was used in the fix for SOLR-2496 as a shortcut for adds, so... > The attached patch adds an "operations" key that can exist at the same level > as any other operation. The "operations" key's value is an array of objects, > each of which uses the same syntax as the root object: > {code} > { > "operations": [ > {"add": {"id": "1"}}, > {"delete": {"query": "foo"}}, > {"add": {"id": "2"}}, > {"commit": {}}, > ] > } > {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org