[ 
https://issues.apache.org/jira/browse/SOLR-8154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Steve Rowe updated SOLR-8154:
-----------------------------
    Attachment: SOLR-8154.patch

Patch with tests against both the to-be-deprecated-and-removed REST Schema API 
and the new bulk Schema API.

The REST API tests succeed - dynamic field creation calls to the 
{{/schema/dynamicfields}} endpoint fail when given {{'required':true}} or 
{{'default':whatever}}.

But the bulk Schema API fails for me under both conditions.  [~upayavira], what 
exactly is the request that properly fails for you when you specify 
{{'required':true}}?

The bulk Schema API issue appears to be that the {{add-dynamic-field}} command 
uses {{SchemaField.create()}} to create the new dynamic field, rather than 
{{ManagedIndexSchema.newDynamicField()}}, which includes quality checks, 
including calling {{IndexSchema.isValidDynamicField()}}, which tests for 
required=true and default values.  The patch switches field creation to 
{{ManagedIndexSchema.newDynamicField()}}.

The bulk Schema API {{add-field}} command has a similar issue: 
{{SchemaField.create()}} is used rather than {{ManagedIndexSchema.newField()}}, 
which also has quality checks.  The patch switches this call as well.

Running all Solr tests now.

> Schema API allows default value when adding dynamic field
> ---------------------------------------------------------
>
>                 Key: SOLR-8154
>                 URL: https://issues.apache.org/jira/browse/SOLR-8154
>             Project: Solr
>          Issue Type: Bug
>          Components: Data-driven Schema
>    Affects Versions: 5.3
>            Reporter: Upayavira
>            Assignee: Steve Rowe
>            Priority: Minor
>         Attachments: SOLR-8154.patch
>
>
> The schema API refuses to create a dynamic field with required=true, but 
> accepts one that has a default value. This creates a schema that cannot be 
> loaded.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to