Very new to elasticsearch
Trying to initialize an index from json using the elasticsearch-py api; using this simple json file to just understand how it's working
{
"index": "index_name",
"body": {
"aliases": {
"actions": [
{ "add": { "index": "index_name", "alias": "alias1" } }
]
},
"mappings": {
"properties": {
"age": { "type": "integer" },
"email": { "type": "keyword" },
"name": { "type": "text" }
}
},
"settings": {
"number_of_shards": 2,
"number_of_replicas": 1,
"index.refresh_interval": "120s"
}
}
}
(read a json file, parse out index
and body
) then the important python part
es.indices.create(index=index, body=body)
But I'm getting an error:
elasticsearch.exceptions.TransportError: TransportError(500, 'null_pointer_exception', 'fieldName cannot be null')
I pulled the mapping and alias example from the ES docs. The python works with a different json file that doesn't have aliases in it. When I remove the aliases from this file I get another error about unsupported mapping parameters so I'm not sure where the problem is, but want to solve the alias issue first