Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-9098

Show if schema is currently mutable or not

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: 7.0
    • Component/s: Schema and Analysis
    • Labels:
      None

      Description

      When our schema is not mutable (for whatever reason) the only way to get that information is to try a change and see if it fails, like this:

      $ curl -i localhost:8983/solr/dummy/schema -d '{ "add-field":{ "name":"sell-by", "type":"tdate", "stored":true } }'
      HTTP/1.1 200 OK
      Content-Type: application/json; charset=UTF-8
      Content-Length: 112
      
      {
        "responseHeader":{
          "status":0,
          "QTime":5
        },
        "errors":[
          {
            "errorMessages":"schema is not editable"
          }
        ]
      }

      this message is caused by SchemaManager#performOperations which checks if schema instanceof ManagedIndexSchema && schema.isMutable() - we could include that information in the response for /schema and allow users to see upfront if they could modify the schema or rather not.

      Steve Rowe i'm not entirely sure that i didn't miss any tests related to the schema handler, would you mind having a look?

        Attachments

        1. SOLR-9098.patch
          1 kB
          Stefan Matheis (steffkes)

          Activity

            People

            • Assignee:
              steffkes Stefan Matheis (steffkes)
              Reporter:
              steffkes Stefan Matheis (steffkes)
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: