epugh opened a new pull request, #5420: URL: https://github.com/apache/solr/pull/5420
https://issues.apache.org/jira/browse/SOLR-18700 (part of [SOLR-18694](https://issues.apache.org/jira/browse/SOLR-18694)) The Delete button in the Schema Designer has been commented out since SOLR-15277, and `deleteSelected()` was an empty stub. Once the designer has added a field, there's no way to remove it until after publishing. ### API Three new endpoints, at the same paths as the Schema API's own deletes (`UpdateSchemaApi`): - `DELETE /api/schema-designer/{configSet}/fields/{fieldName}?schemaVersion=` - `DELETE /api/schema-designer/{configSet}/dynamicfields/{dynamicFieldName}?schemaVersion=` - `DELETE /api/schema-designer/{configSet}/fieldtypes/{fieldTypeName}?schemaVersion=` ### Server - Deletes go through the Schema API on the temp collection, as `addSchemaObject` already does. - Deleting a field or dynamic field also deletes the copy fields from or to it, in one `MultiUpdate`. Otherwise the Schema API would refuse the delete. - Deleting a field type that is still in use is refused with the Schema API's own error. - The uniqueKey field, `_version_`, `_root_` and `_nest_path_` are refused with a 400. `_root_` and `_nest_path_` belong to the nested-docs toggle. - The sample docs are re-indexed afterwards, and the response is built from the schema as it stands after re-indexing. ### UI - The Delete button is back, with an inline confirmation instead of a browser dialog. It's hidden for the fields that can't be deleted. - Dynamic fields use `field/<name>` tree ids, the same as fields, so the UI checks the name against the dynamic field list to pick the endpoint. - If field guessing puts a deleted field back because the sample docs still contain it, the UI shows a warning. ### Docs Replaces "The Schema Designer does not support deleting fields from the schema." in `schema-designer.adoc`. #5412 adds a NOTE to that page about deleting fields with the Schema API after publishing; whichever PR merges second should update it. ### Tests - `TestSchemaDesigner.testDeleteSchemaObjects`: each kind of delete, copy-field cleanup, an in-use type, and the protected fields. - `TestSchemaDesigner.testDeleteFieldReindexesSampleDocs`: a deleted `genre_s` falls back to `*_s`, and field guessing re-adds a field still in the sample docs. - `AdminUiSchemaDesignerTest` deletes the field it adds (`-Ptests.selenium=true`). `gradlew check -x test` passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018RwsEmM9zRWihYjszWDGK9 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
