You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Mateusz Owdziej (JIRA)" <ji...@apache.org> on 2017/11/16 07:58:00 UTC

[jira] [Commented] (SOLR-9052) Provide a syntax for Adding Multiple Documents on REST that Uses Proper JSON Format

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

Mateusz Owdziej commented on SOLR-9052:
---------------------------------------

What about accepting json with add key as array and other commands (e.g. delete). It is difficult (or impossible) to create json with multiply "add" keys. 
Proposition: 
{code}
{
   "add":{
      "doc":[
         {
            "id":"DOC1",
            "my_field":2.3
         },
         {
            "id":"DOC2",
            "my_field":4.2
         }
      ]
   },
   "commit":{   },
   "optimize":{  "waitSearcher":false  },
   "delete":[
      { "id":"ID" },
      { "query":"QUERY" }
   ]
}{code}

How to make such action using rest api: delete all documents, add new one and after that commit everything?


> Provide a syntax for Adding Multiple Documents on REST that Uses Proper JSON Format
> -----------------------------------------------------------------------------------
>
>                 Key: SOLR-9052
>                 URL: https://issues.apache.org/jira/browse/SOLR-9052
>             Project: Solr
>          Issue Type: Improvement
>          Components: update
>            Reporter: Mary Jo Sminkey
>
> Currently if you want to post a batch of documents to the update handler and need to include any options like a boost for each, you have to use a format that uses multiple "add" keys, which make it virtually impossible to build an object in another language and serialize it since most do not allow multiple keys of the same name. Many JSON formatters and validators as well will not allow this. While the JSON specs do not exclude it outright, they do say that keys "SHOULD" be unique and certainly not having unique keys results in a multitude of issues when trying to work with Solr from other languages. Please add a way to send multiple documents to the update handler via the REST Api that does not require using multiple "add" keys. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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