elasticsearch/elasticsearch — pull request #2304 by lindstromhenrik (2012-10-04 15:22:23+00:00)
Title: Get _mapping on a empty index with no mappings passed when created returns 404

Given an empty index with no mappings passed when created returns 404 when requesting _mapping. Should the "empty" mapping be considered "empty" or "non existant"?

PUT localhost:9200/myindex

GET localhost:9200/myindex/_mapping
=> returns the empty mapping:
{
"myindex": {}
}
with status 404.

Should this be considered as a bug or by design?

This pull request resolves the issue by returning 200 if the index has no mappings and no types passed to the _mapping-call.