Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mapping: First index of nested value as an array fails when dynamic is strict #7304

Closed
clintongormley opened this issue Aug 16, 2014 · 2 comments · Fixed by #7307
Closed
Assignees
Labels

Comments

@clintongormley
Copy link
Contributor

This works on 1.3.1, fails in master:

DELETE /myapp
PUT /myapp
{
   "mappings" : {
      "multiuser" : {
         "properties" : {
            "timestamp" : {
               "type" : "date"
            },
            "entry" : {
               "properties" : {
                  "last" : {
                     "type" : "string"
                  },
                  "first" : {
                     "type" : "string"
                  }
               },
               "dynamic" : "strict",
               "type" : "nested"
            }
         },
         "_timestamp" : {
            "path" : "timestamp",
            "enabled" : 1
         },
         "numeric_detection" : 1,
         "dynamic" : "strict"
      }
   },
   "settings" : {}
}

POST /myapp/multiuser?op_type=create
{
   "timestamp" : 1408198082386,
   "entry" : [
      {
         "first" : "john",
         "last" : "smith"
      }
   ]
}

This throws: StrictDynamicMappingException[mapping set to strict, dynamic introduction of [entry] within [multiuser] is not allowed]

at org.elasticsearch.index.mapper.object.ObjectMapper.serializeArray(ObjectMapper.java:604)
at org.elasticsearch.index.mapper.object.ObjectMapper.parse(ObjectMapper.java:489)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:533)
at org.elasticsearch.index.mapper.DocumentMapper.parse(DocumentMapper.java:482)
at org.elasticsearch.index.shard.service.InternalIndexShard.prepareCreate(InternalIndexShard.java:384)
at org.elasticsearch.action.index.TransportIndexAction.shardOperationOnPrimary(TransportIndexAction.java:193)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction.performOnPrimary(TransportShardReplicationOperationAction.java:532)
at org.elasticsearch.action.support.replication.TransportShardReplicationOperationAction$AsyncShardOperationAction$1.run(TransportShardReplicationOperationAction.java:431)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:722)
@clintongormley
Copy link
Contributor Author

@colings86 i think this may be related to the change in #6939

@colings86 colings86 changed the title First index of nested value as an array fails when dynamic is strict Mapping: First index of nested value as an array fails when dynamic is strict Aug 18, 2014
@jpountz
Copy link
Contributor

jpountz commented Aug 18, 2014

I'm not sure this change needs version labels since the bug has not been released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants