Skip to content

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 Foundations/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

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 Foundations/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.

4 participants