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

schema api sometimes fails to replace-field-type

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 8.4.1
    • 8.8
    • Schema and Analysis

    Description

      When updating a schema via POST to  /solr/COLLECTION/schema using  replace-field-type , the call fails if the schema has existing copy-fields whose destination references a non-dynamic field of the  field-type which is being updated.

       
      Example steps: # on a blank schema, add a field type and copy-field by POSTing

      {
      "add-field-type": [
      {
      "name": "spellcheck", "class": "solr.TextField","positionIncrementGap": "100",
      "analyzer": {
      "tokenizer":

      { "class": "solr.StandardTokenizerFactory" }

      }
      }
      ],
      "add-field": [

      { "name": "spellcheck", "type": "spellcheck", "multiValued": true, "indexed": true, "stored": true }

      ],
      "add-copy-field": [

      { "source": "important_data_s", "dest": "spellcheck" }

      ]
      }
      2. Later, send an update for the field type
      {
      "replace-field-type": [
      {
      "name": "spellcheck", "class": "solr.TextField","positionIncrementGap": "100",
      "analyzer": {
      "tokenizer":

      { "class": "solr.StandardTokenizerFactory" }

      }
      }
      ]
      }
      This results in "errorMessages":["Source or Destination SchemaField can't be NULL.\n"]}],}}The error does not trigger if, as mentioned above, the destination of the existing copy-field is dynamic OR if the source field mapping contains a wildcard e.g. {{*foo_s (edited) 

      Attachments

        Issue Links

          Activity

            People

              munendrasn Munendra S N
              aeshumway Andrew Shumway
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m