You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by "Jason Gerlowski (Jira)" <ji...@apache.org> on 2022/02/21 20:45:00 UTC

[jira] [Commented] (SOLR-6476) Create a bulk mode for schema API

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

Jason Gerlowski commented on SOLR-6476:
---------------------------------------

bq. [Yonik] People hate repeated keys in JSON... we should avoid adding more of that if possible.

bq. [Noble] actually both formats are supported [...] But it is useful when order is important.

I stumbled on this decision after going down a rabbit hole this afternoon and am a bit confused.  I understand in general why operation ordering is important: field-types need to be created before a field can be created with that type, fields need created before a copyfield uses them as a destination, etc.  But at first glance, those are all compatible with the JSON list based syntax that Yonik suggested.

[~noble.paul] Do you remember what sort of bulk request you had in mind that wouldn't work with the key->array-of-values syntax that Yonik suggested?  I must be missing something obvious.

> Create a bulk mode for schema API
> ---------------------------------
>
>                 Key: SOLR-6476
>                 URL: https://issues.apache.org/jira/browse/SOLR-6476
>             Project: Solr
>          Issue Type: New Feature
>          Components: Schema and Analysis
>            Reporter: Noble Paul
>            Assignee: Noble Paul
>            Priority: Major
>              Labels: managedResource
>             Fix For: 5.0, 6.0
>
>         Attachments: SOLR-6476.patch, SOLR-6476.patch, SOLR-6476.patch, SOLR-6476.patch, SOLR-6476.patch, SOLR-6476.patch, SOLR-6476.patch, SOLR-6476.patch
>
>
> The current schema API does one operation at a time and the normal usecase is that users add multiple fields/fieldtypes/copyFields etc in one shot.
> example 
> {code}
> curl http://localhost:8983/solr/collection1/schema -H 'Content-type:application/json'  -d '{
>     "add-field": {
>         "name":"sell-by",
>         "type":"tdate",
>         "stored":true
>     },
>     "add-field":{
>         "name":"catchall",
>         "type":"text_general",
>         "stored":false
>     }
> }
> {code}
> or 
> {code}
> curl http://localhost:8983/solr/collection1/schema -H 'Content-type:application/json'  -d '{
>     "add-field":[ {
>         "name":"sell-by",
>         "type":"tdate",
>         "stored":true
>     },
>     {
>         "name":"catchall",
>         "type":"text_general",
>         "stored":false
>     }]
> }
> {code}



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org