We're attempting to migrate from Elasticsearch 5.6.6 to the latest (6.3.1). In doing so we can no longer create the index template we use. When I attempt to do so I get this error:
[2018-07-17T20:54:06,310][WARN ][r.suppressed ] path: /_template/news-development-template, params: {name=news-development-template}
org.elasticsearch.common.settings.SettingsException: Failed to load settings from [{"index":{"analysis":{"filter":{"url_filter_without_protocol":{"type":"pattern_capture","preserve_original":false,"flags":"CASE_INSENSITIVE","patterns":["(?:https?://)?(?:www.)?([^:\n]+)"]}},"analyzer":{"proper_noun_analyzer":{"filter":[{"type":"stop","stopwords":"_english_"}],"tokenizer":"classic"},"url_analyzer":{"tokenizer":"uax_url_email"},"url_analyzer_without_protocol":{"type":"custom","tokenizer":"keyword","filter":["url_filter_without_protocol"]}}},"number_of_shards":1,"number_of_replicas":0},"index.mapper.dynamic":false}]
at org.elasticsearch.common.settings.Settings$Builder.loadFromSource(Settings.java:1151) ~[elasticsearch-6.1.4.jar:6.1.4]
Caused by: java.lang.IllegalStateException: only value lists are allowed in serialized settings
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:715) ~[elasticsearch-6.1.4.jar:6.1.4]
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:704) ~[elasticsearch-6.1.4.jar:6.1.4]
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:704) ~[elasticsearch-6.1.4.jar:6.1.4]
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:704) ~[elasticsearch-6.1.4.jar:6.1.4]
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:704) ~[elasticsearch-6.1.4.jar:6.1.4]
at org.elasticsearch.common.settings.Settings.fromXContent(Settings.java:673) ~[elasticsearch-6.1.4.jar:6.1.4]
at org.elasticsearch.common.settings.Settings.access$500(Settings.java:82) ~[elasticsearch-6.1.4.jar:6.1.4]
at org.elasticsearch.common.settings.Settings$Builder.loadFromSource(Settings.java:1149) ~[elasticsearch-6.1.4.jar:6.1.4]
... 52 more
Our index template looks like this:
{
"index_patterns": [
"news-development-*"
],
"version": 12,
"aliases": {
"news-development": {
}
},
"settings": {
"index": {
"analysis": {
"filter": {
"url_filter_without_protocol": {
"type": "pattern_capture",
"preserve_original": false,
"flags": "CASE_INSENSITIVE",
"patterns": [
"(?:https?://)?(?:www.)?([^:\n]+)"
]
}
},
"analyzer": {
"proper_noun_analyzer": {
"filter": [
{
"type": "stop",
"stopwords": "_english_"
}
],
"tokenizer": "classic"
},
"url_analyzer": {
"tokenizer": "uax_url_email"
},
"url_analyzer_without_protocol": {
"type": "custom",
"tokenizer": "keyword",
"filter": [
"url_filter_without_protocol"
]
}
}
},
"number_of_shards": 1,
"number_of_replicas": 0
},
"index.mapper.dynamic": false
},
"mappings": {
"item": {
"properties": {
"title": {
"type": "text",
"analyzer": "proper_noun_analyzer",
"fields": {
"case_insensitive": {
"type": "text",
"analyzer": "standard"
}
}
},
"content": {
"properties": {
"raw": {
"type": "text"
},
"raw_content_length": {
"type": "integer"
},
"stripped": {
"type": "text",
"analyzer": "proper_noun_analyzer"
},
"stripped_content_length": {
"type": "integer"
}
}
},
"entities": {
"type": "nested",
"properties": {
"name": {
"type": "text"
},
"type": {
"type": "keyword"
},
"occurrence": {
"type": "float"
}
}
},
"links": {
"properties": {
"text": {
"type": "text"
},
"href": {
"type": "text",
"analyzer": "url_analyzer_without_protocol"
}
}
},
"source_url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"feed_url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"sitemap_url": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword"
}
}
},
"website_url": {
"type": "keyword"
},
"event_type": {
"type": "keyword"
},
"feed_type": {
"type": "keyword"
},
"source_type": {
"type": "keyword"
},
"document_id": {
"type": "keyword"
},
"published_at": {
"type": "date"
},
"requested_at": {
"type": "date"
},
"company_ids": {
"type": "keyword"
}
},
"_meta": {
"version": 12
}
}
}
}
If I remove the analysis
section, as well as any reference to those custom analyzers, the index template will create successfully. AFAICT the analysis section is correct, but something is clearly not working correctly here, or we've missed a change required for the upgrade.
Any help is much appreciated.