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 2023/03/17 15:22:00 UTC

[jira] [Comment Edited] (SOLR-16395) Cosmetic improvements and migration to JAX-RS (schema APIs)

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

Jason Gerlowski edited comment on SOLR-16395 at 3/17/23 3:21 PM:
-----------------------------------------------------------------

To be a little more explicit about the APIs we want this ticket to cover, I found 9 APIs that need work related to schema modification: 

(*EDIT*: List moved to tables in issue description)

Obviously this is a big list.  IMO it makes sense to split these up across different PRs, doing some small number (i.e. 1 or 2) of APIs per-PR.  If anyone wants to help chip away at this, just call out which APIs from this list you intend to work on and we can parallelize them.

In terms of the steps required, the JIRA comments [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617806&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617806] and [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617923&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617923] give some good background and step-by-step instructions for switching APIs over to the new JAX-RS framework, which is usually helpful or even required as the traditional v2 framework doesn't lend itself very readily to RESTful APIs.  (Those comments describe creating a new API "from scratch", but the steps are still applicable to modifying an existing API.)  The PR [here|https://github.com/apache/solr/pull/1053] also serves as a helpful example to work from.

Not all API modifications require the new JAX-RS framework, though it is preferred going forward.  Instructions for updating APIs using the older, traditional v2 framework can be found [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17565076&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17565076], and an example PR can be found [here|https://github.com/apache/solr/pull/1061].


was (Author: gerlowskija):
To be a little more explicit about the APIs we want this ticket to cover, I found 9 APIs that need work related to schema modification: 

* Create/Update field
** Current Form: POST /api/collections/collName/schema \{"add-field": \{...\}\}
** Desired Form: PUT /api/collections/collName/schema/fields/fieldName \{...\}
** Spreadsheet Ref: Tab 2, Line 27
* Delete field
** Current Form: POST /api/collections/collName/schema \{"delete-field": \{...\}\}
** Desired Form: DELETE /api/collections/collName/schema/fields/fieldName
** Spreadsheet Ref: Tab 2, Line 28
* Create/Update Dynamic Field
** Current Form: POST /api/collections/collName/schema \{"add-dynamic-field": \{...\}\}
** Desired Form: PUT /api/collections/collName/schema/dynamicfields/fieldName
** Spreadsheet Ref: Tab 2, Line 30
* Delete dynamic field
** Current Form: POST /api/collections/collName/schema \{"delete-dynamic-field": \{...\}\}
** Desired Form: DELETE /api/collections/collName/schema/dynamicfields/fieldName
** Spreadsheet Ref: Tab2, 31
* Create/Update Field Type
** Current Form: POST /api/collections/collName/schema \{"add-field-type": \{...\}\}
** Desired Form: PUT /api/collections/collName/schema/fieldtypes/fieldTypeName
** Spreadsheet Ref: Tab 2, Line 33
* Delete Field Type
** Current Form: POST /api/collections/collName/schema \{"delete-field-type": \{...\}\}
** Desired Form: DELETE /api/collections/collName/schema/fieldTypes/fieldTypeName
** Spreadsheet Ref: Tab 2, Line 34
* Add Copy Field
** Current Form: POST /api/collections/collName/schema \{"add-copy-field": \{...\}\}
** Desired Form: PUT /api/collections/collName/schema/copyfields/copyFieldName
** Spreadsheet Ref: Tab 2, Line 36
* Delete Copy Field
** Current Form: POST /api/collections/collName/schema \{"delete-copy-field": \{...\}\}
** Desired Form: DELETE /api/collections/collName/schema/copyfields/copyFieldName
** Spreadsheet Ref: Tab 2, Line 37
* Bulk Schema Operations
** Current Form: POST /api/collections/collName/schema \{"add-field": \{...\}, "add-field": \{...\}\} (notice the duplicate keys)
** Desired Form: POST /api/collections/collName/schema/bulk [{...}, {...}]
** Spreadsheet Ref: Tab 2, Line 38


Obviously this is a big list.  IMO it makes sense to split these up across different PRs, doing some small number (i.e. 1 or 2) of APIs per-PR.  If anyone wants to help chip away at this, just call out which APIs from this list you intend to work on and we can parallelize them.

In terms of the steps required, the JIRA comments [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617806&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617806] and [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17617923&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17617923] give some good background and step-by-step instructions for switching APIs over to the new JAX-RS framework, which is usually helpful or even required as the traditional v2 framework doesn't lend itself very readily to RESTful APIs.  (Those comments describe creating a new API "from scratch", but the steps are still applicable to modifying an existing API.)  The PR [here|https://github.com/apache/solr/pull/1053] also serves as a helpful example to work from.

Not all API modifications require the new JAX-RS framework, though it is preferred going forward.  Instructions for updating APIs using the older, traditional v2 framework can be found [here|https://issues.apache.org/jira/browse/SOLR-15737?focusedCommentId=17565076&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-17565076], and an example PR can be found [here|https://github.com/apache/solr/pull/1061].

> Cosmetic improvements and migration to JAX-RS (schema APIs)
> -----------------------------------------------------------
>
>                 Key: SOLR-16395
>                 URL: https://issues.apache.org/jira/browse/SOLR-16395
>             Project: Solr
>          Issue Type: Sub-task
>          Components: v2 API
>    Affects Versions: main (10.0)
>            Reporter: Jason Gerlowski
>            Priority: Major
>
> As mentioned on SOLR-15781, the v2 API currently has an experimental designation, and the community has expressed an interest in using this period to update our v2 endpoints to be more REST-ful and consistent.  The current plan is to follow the specific changes laid out in [this spreadsheet|https://docs.google.com/spreadsheets/d/1HAoBBFPpSiT8mJmgNZKkZAPwfCfPvlc08m5jz3fQBpA/edit?usp=sharing], though of course nothing there is set in stone and there are still warts to be worked out.
> While we're touching the code for these endpoints, we should also convert them to JAX-RS framework definitions.  (This was initially tracked as a separate effort - see SOLR-16370 - but the edit that were required ended up overlapping so significantly with the "cosmetic" improvements here that in practice it almost always makes sense to do the two together.)
> This ticket plans to tackle making the changes required for Solr's schema read and collection-overlay APIs, as described in the spreadsheet above.  For convenience and ease of tracking, these are also summarized in the table(s) below:
> *Cosmetic Changes and JAX-RS Conversion*
> ||API Name||Original Form||Desired Form||Status||Volunteer||
> |Create Field|POST /api/collections/collName/schema \{"add-field": \{...\}\}|PUT /api/collections/collName/schema/fields/fieldName \{...\}|Open|N/A|
> |Update Field|POST /api/collections/collName/schema \{"replace-field": \{...\}\}|PUT /api/collections/collName/schema/fields/fieldName \{...\}|Open|N/A|
> |Delete Field|POST /api/collections/collName/schema \{"delete-field": \{...\}\}|DELETE /api/collections/collName/schema/fields/fieldName|Open|N/A|
> |Create Dynamic Field|POST /api/collections/collName/schema \{"add-dynamic-field": \{...\}\}|PUT /api/collections/collName/schema/dynamicfields/fieldName \{...\}|Open|N/A|
> |Update Dynamic Field|POST /api/collections/collName/schema \{"replace-dynamic-field": \{...\}\}|PUT /api/collections/collName/schema/dynamicfields/fieldName \{...\}|Open|N/A|
> |Delete Dynamic Field|POST /api/collections/collName/schema \{"delete-dynamic-field": \{...\}\}|DELETE /api/collections/collName/schema/dynamicfields/fieldName|Open|N/A|
> |Create Field Type|POST /api/collections/collName/schema \{"add-field-type": \{...\}\}|PUT /api/collections/collName/schema/fieldtypes/fieldTypeName \{...\}|Open|N/A|
> |Update Field Type|POST /api/collections/collName/schema \{"replace-field-type": \{...\}\}|PUT /api/collections/collName/schema/fieldtypes/fieldTypeName \{...\}|Open|N/A|
> |Delete Field Type|POST /api/collections/collName/schema \{"delete-field-type": \{...\}\}|DELETE /api/collections/collName/schema/fieldTypes/fieldTypeName|Open|N/A|
> |Add Copy-field|POST /api/collections/collName/schema \{"add-copy-field": \{...\}\}|PUT /api/collections/collName/schema/copyfields/copyFieldName \{...\}|Open|N/A|
> |Delete Copy-field|POST /api/collections/collName/schema \{"delete-copy-field": \{...\}\}|DELETE /api/collections/collName/schema/copyfields/copyFieldName|Open|N/A|
> |Bulk Schema Operations|POST /api/collections/collName/schema \{"add-field": \{...\}, "add-field": \{...\}\}|POST /api/collections/collName/schema/bulk [\{...\}, \{...\}]|Open|N/A|
> *JAX-RS Conversion Only*
> ||API Name||Endpoint Format||Status||Volunteer||
> |Get Entire Schema|GET /api/collections/collName/schema|Open|N/A|
> |Get Schema UniqueKey|GET /api/collections/collName/schema/uniquekey|Open|N/A|
> |Get Schema Version|GET /api/collections/collName/schema/version|Open|N/A|
> |Get Schema Similarity|GET /api/collections/collName/schema/similarity|Open|N/A|
> |Get Schema ZkVersion|GET /api/collections/collName/schema/zkversion|Open|N/A|
> |List All (Non-dynamic) Fields|GET /api/collections/collName/schema/fields|Open|N/A|
> |Get Single (Non-dynamic) Field|GET /api/collections/collName/schema/fields/fieldName|Open|N/A|
> |List Copyfields|GET /api/collections/collName/schema/copyfields|Open|N/A|
> |List All (Dynamic) Fields|GET /api/collections/collName/schema/dynamicfields|Open|N/A|
> |Get Single (Dynamic) Field|GET /api/collections/collName/schema/dynamicfields/fieldName|Open|N/A|
> |List All FieldTypes|GET /api/collections/collName/schema/fieldtypes|Open|N/A|
> |Get Single Fieldtype|GET /api/collections/collName/schema/fieldtypes/fieldTypeName|Open|N/A|



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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