Closed clintongormley closed 8 years ago
Hi @plebedev
Your issue is correct, but is a real edge case. I think it's one for the migration tool rather than anything we plan to fix in elasticsearch. I'll move it there.
ES 2.3 rewrites these mappings to a valid form, so I'm going to close this
From @plebedev on April 1, 2016 19:49
Elasticsearch version: 2.2.0
JVM version: 1.7 or 1.8
OS version: OSX 10.9.5 but it does not really matter, issue is reproducible on various Linux flavors as well.
Description of the problem including expected versus actual behavior: Looks like there was a change in 2.2 related to analyzers. In 2.0 you can specify analyzer and search_analyzer on any filed type. In 2.2 you can only do it for 'string' types. It maybe makes sense but it is not compatible with previous versions and many cases fail in different way.
Steps to reproduce: With 2.0.2, create a new index:
Upgrade ES to 2.2.1
Try to update the mapping:
This fails with the error:
If you look at the index after you created it with 2.0.1, you will see "search_analyzer": "_keyword" added to prop1.
Now, delete the index and try to create it again:
This now fails with this error:
So, if you had a mapping with an analyzer set on non-string field in 2.0, and then migrate to 2.2, you can't update existing mappings, nor you can create the same mapping on a fresh installation without modifying the put request.
Copied from original issue: elastic/elasticsearch#17485