[ 
https://issues.apache.org/jira/browse/SOLR-8607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15122720#comment-15122720
 ] 

Steve Rowe commented on SOLR-8607:
----------------------------------

I see this same problem for other dynamic fields, not just the catch all {{*}}.

To reproduce:

{noformat}
$ bin/solr -e schemaless
$ curl http://localhost:8983/solr/gettingstarted/schema
[...]
"dynamicFields":[...,{"name":"*_txt", "type":"text_general", "indexed":true, 
"stored":true},
[...] 
$ curl -X POST -H "Content-type:application/json" --data-binary '{"add-field": 
{"name":"new_txt","type":"string","indexed":"true","stored":"true"}}' 
http://localhost:8983/solr/gettingstarted/update
[...]
"errorMessages":["Field 'new_txt' already exists.\n"]}]}
{noformat}

> In Managed schema mode, Schema API throws error when adding new fields if the 
> all catch dynamic field is defined
> ----------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-8607
>                 URL: https://issues.apache.org/jira/browse/SOLR-8607
>             Project: Solr
>          Issue Type: Bug
>          Components: Data-driven Schema
>    Affects Versions: 5.3.1
>            Reporter: kiran
>            Priority: Minor
>
> If the all catch dynamic field '*' is present in a managed schema collection, 
> then any field creation requests through Schema API return the 
> confusing/weird error "Field $\{FIELD_NAME\} already exists".
> *Schema of a test collection*: 
> {code}
> curl -X GET http://localhost:8983/solr/testSQLQueries-eventsim/schema
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":0},
>   "schema":{
>     "name":"example",
>     "version":1.5,
>     "uniqueKey":"id",
>     "fieldTypes":[{
>         "name":"boolean",
>         "class":"solr.BoolField",
>         "sortMissingLast":true},
>       {
>         "name":"double",
>         "class":"solr.TrieDoubleField",
>         "positionIncrementGap":"0",
>         "precisionStep":"0"},
>       {
>         "name":"float",
>         "class":"solr.TrieFloatField",
>         "positionIncrementGap":"0",
>         "precisionStep":"0"},
>       {
>         "name":"int",
>         "class":"solr.TrieIntField",
>         "positionIncrementGap":"0",
>         "precisionStep":"0"},
>       {
>         "name":"long",
>         "class":"solr.TrieLongField",
>         "precisionStep":"6"},
>       {
>         "name":"string",
>         "class":"solr.StrField",
>         "sortMissingLast":true},
>       {
>         "name":"tdate",
>         "class":"solr.TrieDateField",
>         "positionIncrementGap":"0",
>         "precisionStep":"6"}],
>     "fields":[{
>         "name":"_root_",
>         "type":"string",
>         "indexed":true,
>         "stored":false},
>       {
>         "name":"_version_",
>         "type":"long",
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"id",
>         "type":"string",
>         "indexed":true,
>         "required":true,
>         "stored":true}],
>     "dynamicFields":[{
>         "name":"*_tdt",
>         "type":"tdate",
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_txt",
>         "type":"string",
>         "multiValued":true,
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_ss",
>         "type":"string",
>         "multiValued":true,
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_ii",
>         "type":"int",
>         "multiValued":true,
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_ls",
>         "type":"long",
>         "multiValued":true,
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_i",
>         "type":"int",
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_s",
>         "type":"string",
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_l",
>         "type":"long",
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_b",
>         "type":"boolean",
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_f",
>         "type":"float",
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*_d",
>         "type":"double",
>         "indexed":true,
>         "stored":true},
>       {
>         "name":"*",
>         "type":"string",
>         "indexed":true,
>         "stored":true}],
>     "copyFields":[]}}
> {code}
> *Create new field 'userId' using Schema API*
> {code}
> curl -X POST -H "Content-type:application/json" --data-binary '{"add-field": 
> {"name":"userId","type":"string","indexed":"true","stored":"true"}}' 
> http://localhost:8983/solr/testSQLQueries-eventsim/schema
> {
>   "responseHeader":{
>     "status":0,
>     "QTime":6},
>   "errors":[{
>       "add-field":{
>         "name":"userId",
>         "type":"string",
>         "indexed":"true",
>         "stored":"true"},
>       "errorMessages":["Field 'userId' already exists.\n"]}]}
> {code}
> The field 'userId' does not exist in the schema but it is also not possible 
> to add this field because of the dynamic field '*'.
> While one should never define dynamic field '*' in a managed schema, the 
> Schema API should atleast return some useful error message.



--
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