elasticsearch/elasticsearch — pull request #7589 by brwe (2014-09-04 12:22:57+00:00)
Title: get field mapping: return _boost and _analyzer by their default names al...

...so

_boost and _analyzer mapping can now be retrieved by their default name
or by given name ("path" for _analyzer, "name" for _boost)
Both still appear with their default name when just retrieving the mapping.
(see SimpleGetFieldMappingTests#testGet_boostAnd_analyzer and
SimpleGetMappingTests#testGet_boostAnd_analyzer)

The index_name handling is removed from _boost. This never worked anyway,
see this test: https://github.com/brwe/elasticsearch/commit/36450043640f49f959d953dfd546f33606cb953a

Change in behavior:

_analyzer was never a field mapper. When defining an analyzer
in a document, the field (_analyzer or custom name) was indexed
with default string field properties. These could be overwritten by
defining an explicit mapping for this field, for example:

```
PUT testidx/doc/_mapping
{
"_analyzer": {
"path": "custom_analyzer"
},
"properties": {
"custom_analyzer": {
"type": "string",
"store": true
}
}
}
```
Now, this explicit mapping will be ignored completely, instead
one can only set the "index" option in the definition of _analyzer
Every other option will be ignored.

Reason for this change:
The documentation says

"By default, the _analyzer field is indexed, it can be disabled by settings index to no in the mapping."

This was not true - the setting was ignored. There was a test
for the explicit definition of the mapping (AnalyzerMapperTests#testAnalyzerMappingExplicit)
but this functionallity was never documented so I assume it is not in use.

closes #7237

Things that worry me:

I made it work, but am unsure if this is too hacky. I just made use of the fact that four different names are used for mappers (name, indexName, indexNameClean and full name) and set the name at the fitting place. However, there is plans for deprecating indexName (#6677) so I am unsure how long this solution will have any worth.

In addition the overwriting of the properties mapping relies on the fact that the order in which mappings are parsed is never changed.

Also, I wonder if the change in behavior for _analyzer qualifies as "breaking change".