Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enforce field names do not contain dot #12068

Merged
merged 1 commit into from
Jul 7, 2015

Conversation

rjernst
Copy link
Member

@rjernst rjernst commented Jul 7, 2015

Field names containing dots can cause problems. For example, @jpountz
made this recreation which causes no error, but can result in a
serialization exception if the type already exists:
https://gist.github.com/jpountz/8c66817e00a322b81f85

But this is not just a potential conflict. It also has larger problems,
since only the leaf mapper is created. The intermediate "foo" object
field would not exist if only "foo.bar" was in the mappings.

This change forbids the use of dots in field names. It also
fixes an issue with passing through the update_all_types setting,
which was always set to true whenever a type already existed (!).

I do not think we should worry about backwards compatibility here. This
should be a hard break (and added to the migration plugin).

Field names containing dots can cause problems. For example, @jpountz
made this recreation which cause no error, but can result in a
serialization exception if the type already exists:
https://gist.github.com/jpountz/8c66817e00a322b81f85

But this is not just a potential conflict. It also has larger problems,
since only the leaf mapper is created. The intermediate "foo" object
field would not exist if only "foo.bar" was in the mappings.

This change forbids the use of dots in field names. It also
fixes an issue with passing through the update_all_types setting,
which was always set to true whenever a type already existed (!).

I do not think we should worry about backwards compatibility here. This
should be a hard break (and added to the migration plugin).
@rjernst rjernst added >breaking v2.0.0-beta1 :Search Foundations/Mapping Index mappings, including merging and defining field types labels Jul 7, 2015
@jpountz
Copy link
Contributor

jpountz commented Jul 7, 2015

The change looks good to me, but I'd like to get @clintongormley 's take on this.

@clintongormley
Copy link

+1

rjernst added a commit that referenced this pull request Jul 7, 2015
Mappings: Enforce field names do not contain dot
@rjernst rjernst merged commit 2cc0382 into elastic:master Jul 7, 2015
@rjernst rjernst deleted the fix/mapper-names-conflict branch July 7, 2015 15:34
@clintongormley clintongormley changed the title Mappings: Enforce field names do not contain dot Enforce field names do not contain dot Aug 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking :Search Foundations/Mapping Index mappings, including merging and defining field types v2.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants