Create index pattern with python

How can I set index pattern with python, before putting any docs?
I came up with this, am I on the right tracks?

query = 
"settings": {
        "number_of_shards": 2,
        "number_of_replicas": 1,
        "mappings": {...},
        "index-pattern" : {
            "title" : "myindex",
            "timeFieldName" : "sendTime",
            "fields" : """[{"name":"_id","type":"string","esTypes":["_id"],"count":0, ...]}"""

es_client.indices.create(index = "myindex" , body = query)

Am I missing sth?

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