Solr
  1. Solr
  2. SOLR-8139

Provide a way for the admin UI to utilize managed schema functionality

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.4
    • Component/s: UI
    • Labels:
      None

      Description

      See the discussion at the related SOLR-8131. The suggestion there is to make managed schema the default in 6.0. To make the new-user experience much smoother in that setup, it would be great if the admin UI had a simple wrapper around the managed schema API.

      It would be a fine thing to have a way of bypassing the whole "find the magic config set, edit it in your favorite editor, figure out how to upload it via zkcli then reload the collection" current paradigm and instead be able to update the schema via the admin UI.

      This should bypass the issues with uploading arbitrary XML to the server that shot down one of the other attempts to edit the schema from the admin UI.

      This is mostly a marker. This could be a significant differentiator between the old and new admin UIs.

      1. add-field.png
        94 kB
        Upayavira
      2. add-field-with-errors.png
        100 kB
        Upayavira
      3. add-field-with-omit-open.png
        96 kB
        Upayavira
      4. SOLR-8139.patch
        93 kB
        Upayavira
      5. SOLR-8139.patch
        103 kB
        Upayavira

        Issue Links

          Activity

          Hide
          Upayavira added a comment -

          Now that collections UI is done and committed (via SOLR-4388) I plan to add core admin style buttons along the top of the schema browser page, and to rename the schema browser page to just "schema".

          Those buttons will support these actions:

          • add field (probably with the option to replace one)
          • delete field
          • add dynamic field (with option to replace one)
          • delete dynamic field
          • add (or replace) a copyField definition
          • delete copyField definition

          I plan to work on this this week.

          Show
          Upayavira added a comment - Now that collections UI is done and committed (via SOLR-4388 ) I plan to add core admin style buttons along the top of the schema browser page, and to rename the schema browser page to just "schema". Those buttons will support these actions: add field (probably with the option to replace one) delete field add dynamic field (with option to replace one) delete dynamic field add (or replace) a copyField definition delete copyField definition I plan to work on this this week.
          Hide
          Erick Erickson added a comment -

          I think you've just short-circuited the entire discussion about whether this should be a blocker to SOLR-8131 .

          Just to make sure I understand, this will use the managed schema API, right? I'm gun-shy of uploading arbitrary XML...

          And is there any way this can be enabled only if the collection's schema is managed? It might be easy to infer by the presence of the managed file in the config.....

          Show
          Erick Erickson added a comment - I think you've just short-circuited the entire discussion about whether this should be a blocker to SOLR-8131 . Just to make sure I understand, this will use the managed schema API, right? I'm gun-shy of uploading arbitrary XML... And is there any way this can be enabled only if the collection's schema is managed? It might be easy to infer by the presence of the managed file in the config.....
          Hide
          Upayavira added a comment -

          This will only use the managed schema API.

          It will need to identify whether the schema is enabled. If it isn't, the buttons won't appear.

          Show
          Upayavira added a comment - This will only use the managed schema API. It will need to identify whether the schema is enabled. If it isn't, the buttons won't appear.
          Hide
          Steve Rowe added a comment -

          Awesome!

          Show
          Steve Rowe added a comment - Awesome!
          Hide
          Upayavira added a comment -

          Steve Rowe The one thing that would be really handy is a simple API that tells me whether the managed schema is enabled or not.

          Currently, if I call /solr/<collection>/schema on a non-managed index, I get a 500 error and this:

          java.lang.NoClassDefFoundError: org/apache/solr/rest/schema/FieldCollectionResource

          I can use that to detect a non-managed schema, but would much prefer it if in that case it just returned:

          {"status": "schema not managed"}

          Is that possible?

          Show
          Upayavira added a comment - Steve Rowe The one thing that would be really handy is a simple API that tells me whether the managed schema is enabled or not. Currently, if I call /solr/<collection>/schema on a non-managed index, I get a 500 error and this: java.lang.NoClassDefFoundError: org/apache/solr/rest/schema/FieldCollectionResource I can use that to detect a non-managed schema, but would much prefer it if in that case it just returned: {"status": "schema not managed"} Is that possible?
          Hide
          Upayavira added a comment -

          Steve Rowe Rebuilding Solr fixed the above exception, taking with it seemingly any easy way for me to detect whether or not the schema is managed, at least via the API. I'd much rather we did it via the API than me have to scout around the configs looking for a managedschema file or such. Possible?

          Show
          Upayavira added a comment - Steve Rowe Rebuilding Solr fixed the above exception, taking with it seemingly any easy way for me to detect whether or not the schema is managed, at least via the API. I'd much rather we did it via the API than me have to scout around the configs looking for a managedschema file or such. Possible?
          Hide
          Steve Rowe added a comment -

          I think the config API should work - not sure how to get individual stuff, but when I get the entire output from solr/core/config?wt=json, I see the following for schemaless:

              "schemaFactory":{"class":"ManagedIndexSchemaFactory"},
          

          and the following for non-managed schema:

              "schemaFactory":{"class":"ClassicIndexSchemaFactory"},
          
          Show
          Steve Rowe added a comment - I think the config API should work - not sure how to get individual stuff, but when I get the entire output from solr/core/config?wt=json , I see the following for schemaless: "schemaFactory":{"class":"ManagedIndexSchemaFactory"}, and the following for non-managed schema: "schemaFactory":{"class":"ClassicIndexSchemaFactory"},
          Hide
          Upayavira added a comment -

          Steve Rowe Perfect! Thx!

          Show
          Upayavira added a comment - Steve Rowe Perfect! Thx!
          Hide
          Upayavira added a comment -

          First pass at schema API support within schema browser:

          • renames schema browser tab to just "schema"
          • adds buttons for creating new field/dynamic field/copy field to top
            (when in editable schema mode)
          • adds a 'delete field' button when in editable schema mode
          • adds 'delete copy field' buttons

          This patch also introduces slightly more 'modal' dialogs - you can now press 'escape' to hide one of the 'add' dialogs.

          Show
          Upayavira added a comment - First pass at schema API support within schema browser: renames schema browser tab to just "schema" adds buttons for creating new field/dynamic field/copy field to top (when in editable schema mode) adds a 'delete field' button when in editable schema mode adds 'delete copy field' buttons This patch also introduces slightly more 'modal' dialogs - you can now press 'escape' to hide one of the 'add' dialogs.
          Hide
          Jan Høydahl added a comment -

          This is cool! And we get extra testing of the APIs as well!

          Show
          Jan Høydahl added a comment - This is cool! And we get extra testing of the APIs as well!
          Hide
          Upayavira added a comment -

          Managed schema patch ready to apply - only trivial tweaks since last patch.

          This diff has been generated correctly via SVN to clearly show changes on top of file moves.

          Show
          Upayavira added a comment - Managed schema patch ready to apply - only trivial tweaks since last patch. This diff has been generated correctly via SVN to clearly show changes on top of file moves.
          Hide
          Alexandre Rafalovitch added a comment - - edited

          Please note that we are hiding the managed-schema file in the file browser as per SOLR-6992. Which may cause some confusion to people looking at the directory structure via the browser. Unless the whole file tab UI is going away of course.

          Show
          Alexandre Rafalovitch added a comment - - edited Please note that we are hiding the managed-schema file in the file browser as per SOLR-6992 . Which may cause some confusion to people looking at the directory structure via the browser. Unless the whole file tab UI is going away of course.
          Hide
          ASF subversion and git services added a comment -

          Commit 1712532 from Upayavira in branch 'dev/trunk'
          [ https://svn.apache.org/r1712532 ]

          SOLR-8139 Rename schema-browser to schema and add managed schema support

          Show
          ASF subversion and git services added a comment - Commit 1712532 from Upayavira in branch 'dev/trunk' [ https://svn.apache.org/r1712532 ] SOLR-8139 Rename schema-browser to schema and add managed schema support
          Hide
          ASF subversion and git services added a comment -

          Commit 1712533 from Upayavira in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1712533 ]

          SOLR-8139 Rename schema-browser to schema and add managed schema support

          Show
          ASF subversion and git services added a comment - Commit 1712533 from Upayavira in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1712533 ] SOLR-8139 Rename schema-browser to schema and add managed schema support
          Hide
          ASF subversion and git services added a comment -

          Commit 1712535 from Upayavira in branch 'dev/trunk'
          [ https://svn.apache.org/r1712535 ]

          SOLR-8139, SOLR-8199 update CHANGES.txt

          Show
          ASF subversion and git services added a comment - Commit 1712535 from Upayavira in branch 'dev/trunk' [ https://svn.apache.org/r1712535 ] SOLR-8139 , SOLR-8199 update CHANGES.txt
          Hide
          ASF subversion and git services added a comment -

          Commit 1712536 from Upayavira in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1712536 ]

          SOLR-8139, SOLR-8199 update CHANGES.txt

          Show
          ASF subversion and git services added a comment - Commit 1712536 from Upayavira in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1712536 ] SOLR-8139 , SOLR-8199 update CHANGES.txt
          Hide
          ASF subversion and git services added a comment -

          Commit 1712832 from Upayavira in branch 'dev/trunk'
          [ https://svn.apache.org/r1712832 ]

          SOLR-8139 Add missing bracket

          Show
          ASF subversion and git services added a comment - Commit 1712832 from Upayavira in branch 'dev/trunk' [ https://svn.apache.org/r1712832 ] SOLR-8139 Add missing bracket
          Hide
          ASF subversion and git services added a comment -

          Commit 1712833 from Upayavira in branch 'dev/branches/branch_5x'
          [ https://svn.apache.org/r1712833 ]

          SOLR-8139 Add missing bracket

          Show
          ASF subversion and git services added a comment - Commit 1712833 from Upayavira in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1712833 ] SOLR-8139 Add missing bracket
          Hide
          Alexandre Rafalovitch added a comment -

          Is this actually resolved for 5.4?

          Show
          Alexandre Rafalovitch added a comment - Is this actually resolved for 5.4?
          Hide
          Upayavira added a comment -

          Alexandre Rafalovitch yes, it is resolved

          Show
          Upayavira added a comment - Alexandre Rafalovitch yes, it is resolved
          Hide
          Alexandre Rafalovitch added a comment -

          Still shows "fix-version: none". Though perhaps you update that later when you are doing the final sweep. Sorry, not sure of exact sequence of events.

          Show
          Alexandre Rafalovitch added a comment - Still shows "fix-version: none". Though perhaps you update that later when you are doing the final sweep. Sorry, not sure of exact sequence of events.
          Hide
          Upayavira added a comment -

          Just me being sloppy. Fixed.

          Show
          Upayavira added a comment - Just me being sloppy. Fixed.

            People

            • Assignee:
              Upayavira
              Reporter:
              Erick Erickson
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development