You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Neil Hooey (JIRA)" <ji...@apache.org> on 2011/05/04 23:51:03 UTC

[jira] [Created] (SOLR-2496) JSON Update Handler doesn't handle multiple docs properly

JSON Update Handler doesn't handle multiple docs properly
---------------------------------------------------------

                 Key: SOLR-2496
                 URL: https://issues.apache.org/jira/browse/SOLR-2496
             Project: Solr
          Issue Type: Bug
          Components: update
    Affects Versions: 3.1
            Reporter: Neil Hooey


The following is the current Solr 3.1 format for sending multiple
documents by JSON. It's not analogous to the XML method, and
isn't easily generated and serialized from a hash in Perl,
Python, Ruby, et al to JSON, because it has duplicate keys for "add".

It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
Near the text: "Here's a simple example of adding more than one document at once:"
{
    "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
    "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
}'

Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
{
    "add": {
        "doc": [
            {"id" : "TestDoc1", "title" : "test1"},
            {"id" : "TestDoc2", "title" : "another test"},
        ],
    },
}

The original XML method:
<add>
    <doc>
       <field name="id">TestDoc1<field><field name="title">"test1"</field>
    </doc>
    <doc>
       <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
    </doc>
</add>


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Resolved] (SOLR-2496) JSON Update Handler doesn't handle multiple docs properly

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yonik Seeley resolved SOLR-2496.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.2

> JSON Update Handler doesn't handle multiple docs properly
> ---------------------------------------------------------
>
>                 Key: SOLR-2496
>                 URL: https://issues.apache.org/jira/browse/SOLR-2496
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 3.1
>            Reporter: Neil Hooey
>              Labels: json, update
>             Fix For: 3.2
>
>         Attachments: SOLR-2496.patch
>
>
> The following is the current Solr 3.1 format for sending multiple documents by JSON. It's not analogous to the XML method, and isn't easily generated and serialized from a hash in Perl, Python, Ruby, et al to JSON, because it has duplicate keys for "add".
> It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
> Near the text: "Here's a simple example of adding more than one document at once:"
> {code}
> {
>     "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
>     "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
> }'
> {code}
> Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
> {code}
> {
>     "add": {
>         "doc": [
>             {"id" : "TestDoc1", "title" : "test1"},
>             {"id" : "TestDoc2", "title" : "another test"},
>         ],
>     },
> }
> {code}
> The original XML method:
> {code}
> <add>
>     <doc>
>        <field name="id">TestDoc1<field><field name="title">"test1"</field>
>     </doc>
>     <doc>
>        <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
>     </doc>
> </add>
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (SOLR-2496) JSON Update Handler doesn't handle multiple docs properly

Posted by "Neil Hooey (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13042480#comment-13042480 ] 

Neil Hooey commented on SOLR-2496:
----------------------------------

Awesome, thanks Yonik!

> JSON Update Handler doesn't handle multiple docs properly
> ---------------------------------------------------------
>
>                 Key: SOLR-2496
>                 URL: https://issues.apache.org/jira/browse/SOLR-2496
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 3.1
>            Reporter: Neil Hooey
>              Labels: json, update
>             Fix For: 3.2
>
>         Attachments: SOLR-2496.patch
>
>
> The following is the current Solr 3.1 format for sending multiple documents by JSON. It's not analogous to the XML method, and isn't easily generated and serialized from a hash in Perl, Python, Ruby, et al to JSON, because it has duplicate keys for "add".
> It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
> Near the text: "Here's a simple example of adding more than one document at once:"
> {code}
> {
>     "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
>     "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
> }'
> {code}
> Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
> {code}
> {
>     "add": {
>         "doc": [
>             {"id" : "TestDoc1", "title" : "test1"},
>             {"id" : "TestDoc2", "title" : "another test"},
>         ],
>     },
> }
> {code}
> The original XML method:
> {code}
> <add>
>     <doc>
>        <field name="id">TestDoc1<field><field name="title">"test1"</field>
>     </doc>
>     <doc>
>        <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
>     </doc>
> </add>
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (SOLR-2496) JSON Update Handler doesn't handle multiple docs properly

Posted by "Neil Hooey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Neil Hooey updated SOLR-2496:
-----------------------------

    Remaining Estimate:     (was: 4h)
     Original Estimate:     (was: 4h)

> JSON Update Handler doesn't handle multiple docs properly
> ---------------------------------------------------------
>
>                 Key: SOLR-2496
>                 URL: https://issues.apache.org/jira/browse/SOLR-2496
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 3.1
>            Reporter: Neil Hooey
>              Labels: json, update
>
> The following is the current Solr 3.1 format for sending multiple
> documents by JSON. It's not analogous to the XML method, and
> isn't easily generated and serialized from a hash in Perl,
> Python, Ruby, et al to JSON, because it has duplicate keys for "add".
> It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
> Near the text: "Here's a simple example of adding more than one document at once:"
> {code}
> {
>     "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
>     "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
> }'
> {code}
> Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
> {code}
> {
>     "add": {
>         "doc": [
>             {"id" : "TestDoc1", "title" : "test1"},
>             {"id" : "TestDoc2", "title" : "another test"},
>         ],
>     },
> }
> {code}
> The original XML method:
> {code}
> <add>
>     <doc>
>        <field name="id">TestDoc1<field><field name="title">"test1"</field>
>     </doc>
>     <doc>
>        <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
>     </doc>
> </add>
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (SOLR-2496) JSON Update Handler doesn't handle multiple docs properly

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Yonik Seeley updated SOLR-2496:
-------------------------------

    Attachment: SOLR-2496.patch

Here's a patch that extends the current syntax with a simplified syntax that allows an array of documents at the top level or inside an "add" command.
It also adds the ability to specify "commitWithin" and "overwrite" on the URL (same as the CSVLoader).

Examples of new simplified syntax:
[{"id":"1"},{"id":"2"}]

{"add":[{"id":"1"},{"id":"2"}]}


> JSON Update Handler doesn't handle multiple docs properly
> ---------------------------------------------------------
>
>                 Key: SOLR-2496
>                 URL: https://issues.apache.org/jira/browse/SOLR-2496
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 3.1
>            Reporter: Neil Hooey
>              Labels: json, update
>         Attachments: SOLR-2496.patch
>
>
> The following is the current Solr 3.1 format for sending multiple documents by JSON. It's not analogous to the XML method, and isn't easily generated and serialized from a hash in Perl, Python, Ruby, et al to JSON, because it has duplicate keys for "add".
> It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
> Near the text: "Here's a simple example of adding more than one document at once:"
> {code}
> {
>     "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
>     "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
> }'
> {code}
> Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
> {code}
> {
>     "add": {
>         "doc": [
>             {"id" : "TestDoc1", "title" : "test1"},
>             {"id" : "TestDoc2", "title" : "another test"},
>         ],
>     },
> }
> {code}
> The original XML method:
> {code}
> <add>
>     <doc>
>        <field name="id">TestDoc1<field><field name="title">"test1"</field>
>     </doc>
>     <doc>
>        <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
>     </doc>
> </add>
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Commented] (SOLR-2496) JSON Update Handler doesn't handle multiple docs properly

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13028999#comment-13028999 ] 

Yonik Seeley commented on SOLR-2496:
------------------------------------

Yeah, I agree we should be able to add multiple docs w/o having to repeat tags in the same hash/object.
I proposed something like what you have, and the original thinking of the current
format is in this issue: SOLR-945


> JSON Update Handler doesn't handle multiple docs properly
> ---------------------------------------------------------
>
>                 Key: SOLR-2496
>                 URL: https://issues.apache.org/jira/browse/SOLR-2496
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 3.1
>            Reporter: Neil Hooey
>              Labels: json, update
>
> The following is the current Solr 3.1 format for sending multiple documents by JSON. It's not analogous to the XML method, and isn't easily generated and serialized from a hash in Perl, Python, Ruby, et al to JSON, because it has duplicate keys for "add".
> It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
> Near the text: "Here's a simple example of adding more than one document at once:"
> {code}
> {
>     "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
>     "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
> }'
> {code}
> Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
> {code}
> {
>     "add": {
>         "doc": [
>             {"id" : "TestDoc1", "title" : "test1"},
>             {"id" : "TestDoc2", "title" : "another test"},
>         ],
>     },
> }
> {code}
> The original XML method:
> {code}
> <add>
>     <doc>
>        <field name="id">TestDoc1<field><field name="title">"test1"</field>
>     </doc>
>     <doc>
>        <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
>     </doc>
> </add>
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (SOLR-2496) JSON Update Handler doesn't handle multiple docs properly

Posted by "Neil Hooey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Neil Hooey updated SOLR-2496:
-----------------------------

    Description: 
The following is the current Solr 3.1 format for sending multiple documents by JSON. It's not analogous to the XML method, and isn't easily generated and serialized from a hash in Perl, Python, Ruby, et al to JSON, because it has duplicate keys for "add".

It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
Near the text: "Here's a simple example of adding more than one document at once:"
{code}
{
    "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
    "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
}'
{code}

Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
{code}
{
    "add": {
        "doc": [
            {"id" : "TestDoc1", "title" : "test1"},
            {"id" : "TestDoc2", "title" : "another test"},
        ],
    },
}
{code}

The original XML method:
{code}
<add>
    <doc>
       <field name="id">TestDoc1<field><field name="title">"test1"</field>
    </doc>
    <doc>
       <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
    </doc>
</add>
{code}

  was:
The following is the current Solr 3.1 format for sending multiple
documents by JSON. It's not analogous to the XML method, and
isn't easily generated and serialized from a hash in Perl,
Python, Ruby, et al to JSON, because it has duplicate keys for "add".

It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
Near the text: "Here's a simple example of adding more than one document at once:"
{code}
{
    "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
    "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
}'
{code}

Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
{code}
{
    "add": {
        "doc": [
            {"id" : "TestDoc1", "title" : "test1"},
            {"id" : "TestDoc2", "title" : "another test"},
        ],
    },
}
{code}

The original XML method:
{code}
<add>
    <doc>
       <field name="id">TestDoc1<field><field name="title">"test1"</field>
    </doc>
    <doc>
       <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
    </doc>
</add>
{code}


> JSON Update Handler doesn't handle multiple docs properly
> ---------------------------------------------------------
>
>                 Key: SOLR-2496
>                 URL: https://issues.apache.org/jira/browse/SOLR-2496
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 3.1
>            Reporter: Neil Hooey
>              Labels: json, update
>
> The following is the current Solr 3.1 format for sending multiple documents by JSON. It's not analogous to the XML method, and isn't easily generated and serialized from a hash in Perl, Python, Ruby, et al to JSON, because it has duplicate keys for "add".
> It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
> Near the text: "Here's a simple example of adding more than one document at once:"
> {code}
> {
>     "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
>     "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
> }'
> {code}
> Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
> {code}
> {
>     "add": {
>         "doc": [
>             {"id" : "TestDoc1", "title" : "test1"},
>             {"id" : "TestDoc2", "title" : "another test"},
>         ],
>     },
> }
> {code}
> The original XML method:
> {code}
> <add>
>     <doc>
>        <field name="id">TestDoc1<field><field name="title">"test1"</field>
>     </doc>
>     <doc>
>        <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
>     </doc>
> </add>
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


[jira] [Updated] (SOLR-2496) JSON Update Handler doesn't handle multiple docs properly

Posted by "Neil Hooey (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-2496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Neil Hooey updated SOLR-2496:
-----------------------------

    Description: 
The following is the current Solr 3.1 format for sending multiple
documents by JSON. It's not analogous to the XML method, and
isn't easily generated and serialized from a hash in Perl,
Python, Ruby, et al to JSON, because it has duplicate keys for "add".

It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
Near the text: "Here's a simple example of adding more than one document at once:"
{code}
{
    "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
    "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
}'
{code}

Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
{code}
{
    "add": {
        "doc": [
            {"id" : "TestDoc1", "title" : "test1"},
            {"id" : "TestDoc2", "title" : "another test"},
        ],
    },
}
{code}

The original XML method:
{code}
<add>
    <doc>
       <field name="id">TestDoc1<field><field name="title">"test1"</field>
    </doc>
    <doc>
       <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
    </doc>
</add>
{code}

  was:
The following is the current Solr 3.1 format for sending multiple
documents by JSON. It's not analogous to the XML method, and
isn't easily generated and serialized from a hash in Perl,
Python, Ruby, et al to JSON, because it has duplicate keys for "add".

It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
Near the text: "Here's a simple example of adding more than one document at once:"
{
    "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
    "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
}'

Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
{
    "add": {
        "doc": [
            {"id" : "TestDoc1", "title" : "test1"},
            {"id" : "TestDoc2", "title" : "another test"},
        ],
    },
}

The original XML method:
<add>
    <doc>
       <field name="id">TestDoc1<field><field name="title">"test1"</field>
    </doc>
    <doc>
       <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
    </doc>
</add>


     Issue Type: Improvement  (was: Bug)

> JSON Update Handler doesn't handle multiple docs properly
> ---------------------------------------------------------
>
>                 Key: SOLR-2496
>                 URL: https://issues.apache.org/jira/browse/SOLR-2496
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>    Affects Versions: 3.1
>            Reporter: Neil Hooey
>              Labels: json, update
>   Original Estimate: 4h
>  Remaining Estimate: 4h
>
> The following is the current Solr 3.1 format for sending multiple
> documents by JSON. It's not analogous to the XML method, and
> isn't easily generated and serialized from a hash in Perl,
> Python, Ruby, et al to JSON, because it has duplicate keys for "add".
> It's cited at this page: http://wiki.apache.org/solr/UpdateJSON
> Near the text: "Here's a simple example of adding more than one document at once:"
> {code}
> {
>     "add": {"doc": {"id" : "TestDoc1", "title" : "test1"} },
>     "add": {"doc": {"id" : "TestDoc2", "title" : "another test"} }
> }'
> {code}
> Here's a better format that's analogous to the XML method of submission, and is easily serialized from a hash to JSON:
> {code}
> {
>     "add": {
>         "doc": [
>             {"id" : "TestDoc1", "title" : "test1"},
>             {"id" : "TestDoc2", "title" : "another test"},
>         ],
>     },
> }
> {code}
> The original XML method:
> {code}
> <add>
>     <doc>
>        <field name="id">TestDoc1<field><field name="title">"test1"</field>
>     </doc>
>     <doc>
>        <field name="id">TestDoc2<field><field name="title">"test2"</field></field>
>     </doc>
> </add>
> {code}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org