Skip to content

Multi-fields will create field names with dots '.' #14957

@brusic

Description

@brusic

One of the breaking changes of Elasticsearch 2.0 was that field names are no longer allowed to have dots: #12068

However, if you use the new multi-field syntax, Elasticsearch will create field name with dots. The documentation supports the behavior. The aggregation in the example is on a field named "city.raw":

https://www.elastic.co/guide/en/elasticsearch/reference/current/multi-fields.html

The unit tests in the code look for field names with dots: https://github.com/elastic/elasticsearch/blob/2.1/core/src/test/java/org/elasticsearch/index/mapper/multifield/MultiFieldTests.java#L88

The tests pass because the check in ObjectMapper$TypeParser only checks the original name.

The field name is built in ContentPath:
https://github.com/elastic/elasticsearch/blob/2.1/core/src/main/java/org/elasticsearch/index/mapper/ContentPath.java#L50
https://github.com/elastic/elasticsearch/blob/2.1/core/src/main/java/org/elasticsearch/index/mapper/ContentPath.java#L80-L87

These field names will fail if the indices are run through the MetaDataIndexUpgradeService. Are dots allowed in this context?

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions