Skip to content

Two "empty" mappings reported differently in field_caps #107031

@astefan

Description

@astefan

Description

The first index has in its request body the mappings and properties elements, while the second one has an empty JSON body.
The _field_caps for the first index returns the metadata fields, while for the second index it returns nothing. From my point of view there is no difference between these two indices when it comes to their mappings, so the output of field_caps should be consistent.

This was tested with Postman REST client with main code from few days ago.

PUT /localhost:9200/test1
{
    "mappings": {
        "properties" : {
            
        }
    }
}

POST /localhost:9200/test1/_field_caps?fields=*
{
    "indices": [
        "test1"
    ],
    "fields": {
        "_routing": {
            "_routing": {
                "type": "_routing",
                "metadata_field": true,
                "searchable": true,
                "aggregatable": false
            }
        },
        "_doc_count": {
            "integer": {
                "type": "integer",
                "metadata_field": true,
                "searchable": false,
                "aggregatable": false
            }
        },
        "_index": {
....

now, another "empty" index:

PUT /localhost:9200/test2
{}

POST /localhost:9200/test2/_field_caps?fields=*
{
    "indices": [
        "test2"
    ],
    "fields": {}
}

Metadata

Metadata

Assignees

Labels

:Search Foundations/MappingIndex mappings, including merging and defining field types>bugTeam:Search FoundationsMeta label for the Search Foundations team in Elasticsearchpriority:normalA label for assessing bug priority to be used by ES engineers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions