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

Make sure to accept empty unnested mappings in create index requests. #37089

Merged
merged 1 commit into from Jan 3, 2019

Conversation

jtibshirani
Copy link
Contributor

@jtibshirani jtibshirani commented Jan 2, 2019

This PR fixes a bug in DocumentMapperParser where empty mappings were rejected unless they were keyed by a type name. It's part of a larger effort to allow for typeless index creation requests.

In index creation requests, we at one point tried to maintain the invariant that all mapping values in the request were nested under the type name. It looks like this bug arose in 2341825 when we made it no longer necessary that mappings be nested under a type name. That commit made it possible to handle non-nested mappings, but did not properly update the initial check for an empty map.

@jtibshirani jtibshirani added >bug :Search/Mapping Index mappings, including merging and defining field types v7.0.0 v6.6.0 v6.7.0 labels Jan 2, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search

@@ -97,17 +97,6 @@ public void testIndexTemplateWithAliasNameEqualToTemplatePattern() {
assertThat(errors.get(0).getMessage(), equalTo("Alias [foobar] cannot be the same as any pattern in [foo, foobar]"));
}

public void testIndexTemplateWithValidateEmptyMapping() throws Exception {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like these tests were added in fd76291, not to guard against a particular bug, but as a means of checking whether index templates were being validated.

@jtibshirani
Copy link
Contributor Author

@elasticmachine run gradle build tests 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Search/Mapping Index mappings, including merging and defining field types v6.6.0 v6.7.0 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants