Create filed with type and format by api

hi
can create a field with the following request?

{"mappings":
    {"properties":
        {"address": 
            {"type":"text","format":"url"}
}
}
}

If not,How can it be created by request with specifying the format?
It can be created manually in Kibana But I want it to be created by request

below request:

PUT index_name { "mappings": { "properties": { "address": { "type": "text", "format": "url" } } } }

answer given in Dev tools:

{ "error" : { "root_cause" : [ { "type" : "mapper_parsing_exception", "reason" : "unknown parameter [format] on mapper [address] of type [text]" } ], "type" : "mapper_parsing_exception", "reason" : "Failed to parse mapping [_doc]: unknown parameter [format] on mapper [address] of type [text]", "caused_by" : { "type" : "mapper_parsing_exception", "reason" : "unknown parameter [format] on mapper [address] of type [text]" } }, "status" : 400 }

Thank you for your kind look :slight_smile:

I think that you are referring to the Kibana interface where you can define some UI properties on an existing field in Elasticsearch.

The PUT index_name command creates the index in Elasticsearch but not anything related in Kibana.

To do what you want, you probably need to call the Kibana REST API.
Which you can not do from the Kibana Dev Console as it's running against Elasticsearch only.

May be look at this: Create data view API | Kibana Guide [8.6] | Elastic


I think I should ask my question more simply!
How to do the above settings with API?

That's basically what I said with:

I'm moving your question to Kibana

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.