Skip to content

Field mapping API unexpectedly returns 404 response #58188

Closed
@tylersmalley

Description

@tylersmalley

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.

  1. 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" }
                }
            }
        }
    }
}
'
  1. Request all fields with include_defaults=true
curl -X GET "localhost:9200/_mapping/field/*?index=publications&allow_no_indices=false&include_defaults=true"
  1. 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

{}%

Metadata

Metadata

Assignees

Labels

:Search Foundations/MappingIndex mappings, including merging and defining field types>bugTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearch

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions