Hi there,
I have problems with importing data because some of my values do not always have the same type.
I expected that this would be no big deal due to Elasticsearch's index.mapping.coerce feature.
So I went ahead and did (using Python):
report = open("mydocument.json",'rb').read()
es.index(index='abc', doc_type="reports", body=report)
However, this failed with a MapperParsingException
current_type [string], merged_type [long]
The documentation (https://www.elastic.co/guide/en/elasticsearch/reference/current/coerce.html) implies that index.mapping.coerce is true by default, but I anyway created my index again and explicitly set the option to true, like so:
es.indices.create(index='abc', body='{settings:{ "index.mapping.coerce": true}}')
Then I had another try at indexing my document, but this time I got stuck at another MapperParsingException:
current_type [double], merged_type [long]
The value in question is a simply 0. I cannot imagine how there can be a problem in coercing this to a double 0.0. Is there anything else I need to configure?
Btw, I use Elasticsearch 2.1
Benjamin