[ES 5.0] Mapping issues

Hi,
We are in the process of validating and upgrading to Elasticsearch 5.0. When creating the new indexes in ES 5.0 we noticed that Kibana 5.0 shows field.keyword as well as field. For example, we have a customerId field that we index, but Kibana shows customerId field but also customerId.keyword in the index mapping. Here is what index mapping on ES 2.3 says:

"customerId": {
    "type": "string",
    "index": "not_analyzed"
}

but here is what the field looks like in ES 5.0:

"customerId": {
	"type": "text",
	"fields": {
		"keyword": {
			"type": "keyword",
			"ignore_above": 256
		}
	}
}

This is really unusual because when I'm creating the entry, I'm doing it in the same way as before except I replaced string with keyword as recommended in the ES 5.0 documentation.

"customerId": {
        "type": "keyword"
}

I would assume the field would be just marked as keyword, but why is it marked as text as well? Or is keyword a subset of text type?

The Kibana index looks super weird as well. I have two entries in it:

customerId => (type: string, format: blank, searchable: false, aggregatable: false, analyzed: true)
customerId.keyword => (type: string, format: blank, searchable: true, aggregatable: true, analyzed: false)

I'm not sure if this is expected behaviour, so I would really appreciate it if someone could elaborate a bit.

Something is wrong here. If you defined a mapping in elasticsearch elasticsearch will respect this mapping and won't change it.

Try again from scratch and if it does not work, share your full script with us.

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