Mappings has been changed for the index aspire-identitycache in version 5.2. The action you must take depends on the need to preserve existing data:
In all code blocks below Kibana is expected to be used for sending requests to Elasticsearch.
In that case simply delete existing index after stopping Aspire. When you start Aspire 5.2 version the index will be automatically created with the new mapping.
DELETE aspire-identitycache
Warning
If you want to preserve settings related to the number of shards or replicas, you must also include the 'settings' part.
PUT aspire-identitycache_new "mappings": { "properties": { "identity": { "properties": { "seedId": { "type": "keyword" }, "timestamp": { "type": "keyword" } } } }, "dynamic_templates": [ { "all_as_keyword": { "path_match": "identity.attributes.*", "mapping": { "type": "keyword" } } }, { "date_to_string": { "match_mapping_type": "date", "mapping": { "type": "text" } } }, { "boolean_to_string": { "match_mapping_type": "boolean", "mapping": { "type": "text" } } }, { "long_to_string": { "match_mapping_type": "long", "mapping": { "type": "text" } } }, { "double_to_string": { "match_mapping_type": "double", "mapping": { "type": "text" } } }, { "binary_to_string": { "match_mapping_type": "binary", "mapping": { "type": "text" } } } ] }
POST _reindex { "source": { "index": "aspire-identitycache" }, "dest": { "index": "aspire-identitycache_new" }, "script": { "lang": "painless", "source": """ String seedHash = null; Map seedHashObject = null; def identity = ctx._source.identity; if (identity != null) { for (def entry : identity.entrySet()) { def val = entry.getValue(); if (val instanceof Map && val.containsKey('attributes')) { seedHash = entry.getKey(); seedHashObject = val; } } } if(seedHash != null){ Map attributes = seedHashObject.get('attributes'); identity.remove(seedHash); identity.put('attributes', attributes); } """ } }
DELETE aspire-identitycache
POST _aliases { "actions": [ { "add": { "index": "aspire-identitycache_new", "alias": "aspire-identitycache" } } ] }