I use a Python script to create an index. For certain reasons, I need it to work on both Elasticsearch 6 and 7, so I want to set include_type_name. I have this line of code:
response = es.indices.create(index=index, body=body, include_type_name=True)
However, I keep getting this error:
elasticsearch.exceptions.TransportError: TransportError(500, 'class_cast_exception', "class java.util.ArrayList cannot be cast to class java.util.Map (java.util.ArrayList and java.util.Map are in module java.base of loader 'bootstrap')")
When I set it to false, it creates the index normally. Any idea why this might be happening?