You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "Andrew Shumway (Jira)" <ji...@apache.org> on 2020/10/19 22:33:00 UTC

[jira] [Created] (SOLR-14950) schema api sometimes fails to replace-field-type

Andrew Shumway created SOLR-14950:
-------------------------------------

             Summary: schema api sometimes fails to replace-field-type
                 Key: SOLR-14950
                 URL: https://issues.apache.org/jira/browse/SOLR-14950
             Project: Solr
          Issue Type: Bug
      Security Level: Public (Default Security Level. Issues are Public)
          Components: Schema and Analysis
    Affects Versions: 8.4.1
            Reporter: Andrew Shumway


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) 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

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