Closed
Description
Elasticsearch version: master/8.0
Description of the problem including expected versus actual behavior: Field mapping API returns an empty response when the mapping contains a property not indexed and requested with include_defaults=true
Steps to reproduce:
Building upon the example provided in the field mapping API docs.
- Create an index containing a property with
index: false
curl -X PUT "localhost:9200/publications?pretty" -H 'Content-Type: application/json' -d'
{
"mappings": {
"properties": {
"id": { "type": "text" },
"title": { "type": "text"},
"abstract": { "type": "text", "index": false },
"author": {
"properties": {
"id": { "type": "text" },
"name": { "type": "text" }
}
}
}
}
}
'
- Request all fields with
include_defaults=true
curl -X GET "localhost:9200/_mapping/field/*?index=publications&allow_no_indices=false&include_defaults=true"
- Observe 404 response
curl -i -X GET "localhost:9200/_mapping/field/*?index=publications&allow_no_indices=false&include_defaults=true"
HTTP/1.1 404 Not Found
content-type: application/json; charset=UTF-8
content-length: 2
{}%