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

Steve Rowe commented on SOLR-6141:
----------------------------------

FYI, replacement (as opposed to just using separate delete and add commands) is 
necessary when other schema elements refer to an element to be replaced - e.g. 
if you try to delete a field type that is used by existing fields or dynamic 
fields, you'll get errors.  

At first I thought this could be special-cased - we could relax checking when 
removing then re-adding a schema element (though figuring out that this is 
happening would be an interesting exercise given the bulk command structure), 
but that wouldn't clean up the data structure bindings (fields and dynamic 
fields -> field types; and copy fields -> fields and dynamic fields).

So in the implementation in the patch, when replacing a schema element, 
bindings are found and refreshed.

> Schema API: Remove fields, dynamic fields, field types and copy fields; and 
> replace fields, dynamic fields and field types
> --------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-6141
>                 URL: https://issues.apache.org/jira/browse/SOLR-6141
>             Project: Solr
>          Issue Type: Sub-task
>          Components: Schema and Analysis
>            Reporter: Christoph Strobl
>            Assignee: Steve Rowe
>              Labels: rest_api
>         Attachments: SOLR-6141.patch
>
>
> It should be possible, via the bulk schema API, to remove and replace the 
> following: 
> # fields
> # dynamic fields
> # field types
> # copy field directives (note: replacement is not applicable to copy fields)
> Removing schema elements that are referred to elsewhere in the schema must be 
> guarded against:
> # Removing a field type should be disallowed when there are fields or dynamic 
> fields of that type.
> # Removing a field should be disallowed when there are copy field directives 
> that use the field as source or destination.
> # Removing a dynamic field should be disallowed when it is the only possible 
> match for a copy field source or destination.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to