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

Default mapping means new types not mapped explicitly #1524

Closed
clintongormley opened this issue Dec 7, 2011 · 0 comments
Closed

Default mapping means new types not mapped explicitly #1524

clintongormley opened this issue Dec 7, 2011 · 0 comments

Comments

@clintongormley
Copy link

If the _default_ mapping for an index matches all the fields in a new type, then that new type is not explicitly mapped, which also means that a delete_mapping doesn't delete the docs of that type.

# [Wed Dec  7 21:38:03 2011] Protocol: http, Server: 192.168.5.10:9200
curl -XPUT 'http://127.0.0.1:9200/foo/?pretty=1'  -d '
{
   "mappings" : {
      "_default_" : {
         "properties" : {
            "bar" : {
               "type" : "string"
            }
         }
      }
   }
}
'

# [Wed Dec  7 21:38:03 2011] Response:
# {
#    "ok" : true,
#    "acknowledged" : true
# }

# [Wed Dec  7 21:38:06 2011] Protocol: http, Server: 192.168.5.10:9200
curl -XPUT 'http://127.0.0.1:9200/foo/bar/1?pretty=1'  -d '
{
   "bar" : "aaa"
}
'

# [Wed Dec  7 21:38:06 2011] Response:
# {
#    "ok" : true,
#    "_index" : "foo",
#    "_id" : "1",
#    "_type" : "bar",
#    "_version" : 1
# }

# [Wed Dec  7 21:38:09 2011] Protocol: http, Server: 192.168.5.10:9200
curl -XGET 'http://127.0.0.1:9200/foo/_mapping?pretty=1' 

# [Wed Dec  7 21:38:09 2011] Response:
# {
#    "foo" : {
#       "_default_" : {
#          "properties" : {
#             "bar" : {
#                "type" : "string"
#             }
#          }
#       }
#    }
# }
@kimchy kimchy closed this as completed in df9f333 Dec 7, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants