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

Reply via email to