Search code examples
elasticsearchelasticsearch-5elasticsearch-2.0

Downgrading Elasticsearch from 5.5.1 to 2.1.0 mapper_parsing_exception


I got a mapping problem with elasticsearch:

I use ES 5.5.1 on my local machine and testet my python programm locally and everything worked (could create index, index data etc.). Now i wanted to deploy my app to a cloud foundry solution which is running ES version 2.1.0.

So i got this mapper_parsing_exception:

{u'status': 400, u'error': {u'caused_by': {u'reason': u'No handler for type [text] declared on field [first_seen]', u'type': u'mapper_parsing_exception'}, u'root_cause': [{u'reason': u'No handler for type [text] declared on field [first_seen]', u'type': u'mapper_parsing_exception'}], u'type': u'mapper_parsing_exception', u'reason': u'Failed to parse mapping [generated]: No handler for type [text] declared on field [first_seen]'}}

On the Elastic website it is written that Versions 2.x don't support the "text" and the "keyword" data type. Instead they will attempt to downgrade "keyword"/"text" into "string".

I used the mapping I created with my local ES instance, because the ELK service instance on the cloud has some problems with dynamic mapping. But this mapping is of course full with "text" and "keyword" data types.

Can I just replace every "text" and "keyword" datatype with the "string" type or is there a different solution avaible?

Thanks for your help! Greez

Edit:

I just converted the keyword datatypes to string ones and added "index": "not_analyzed" to these fields to get the same functionality as before. I thought that the dynamic mapping on my cloud ES instance didn't work properly, but I saw now, that i actually works pretty well and I just have to make minor manual mapping ajustments.


Solution

  • it is not only the string type, but you also have to configure whether a field should be analyzed or not (otherwise you will not get the keyword functionality).