Skip to content

Conversation

@romseygeek
Copy link
Contributor

We only have a single mapper per MapperService now anyway, so the extra
type parameter is surplus to requirements.

Relates to #41059

@romseygeek romseygeek added :Search Foundations/Mapping Index mappings, including merging and defining field types >refactoring v8.0.0 labels Oct 28, 2019
@romseygeek romseygeek self-assigned this Oct 28, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (:Search/Mapping)

Copy link
Contributor

@jtibshirani jtibshirani left a comment

Choose a reason for hiding this comment

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

This looks good to me, just left a small comment + question.

.endObject().endObject().endObject()), serialize(update));
}

public void testReuseExistingMappings() throws IOException, Exception {
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a pretty useful test, and could make sense even when there is only one type. Instead of deleting it, we could validate that the update variable below is null?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

++ I re-added the test and updated it accordingly.

};

private XContentBuilder createMapping() throws Exception {
XContentBuilder xcb = XContentFactory.jsonBuilder().startObject().startObject("type1")
Copy link
Contributor

Choose a reason for hiding this comment

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

To check I'm not missing something, these changes are just for clean-up (and not required to get tests to pass)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this has bled in from a different branch (the PR for #47792) - will clean up

@romseygeek
Copy link
Contributor Author

@elasticmachine run elasticsearch-ci/bwc

@romseygeek
Copy link
Contributor Author

@elasticmachine update branch

private DocumentMapperForType docMapper() {
return mapperService.documentMapperWithAutoCreate(
mapperService.resolveDocumentType(MapperService.SINGLE_MAPPING_NAME));
return mapperService.documentMapperWithAutoCreate();
Copy link
Contributor

Choose a reason for hiding this comment

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

To check my understanding, this is fine to change because the type is no longer relevant to indexing (for example we already removed type information from the translog)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct - we can't remove MapperService#resolveDocumentType yet because it's still used by DocumentMapperParser, but that's on the list...

…-document-mapper' into types-removal/mapper-service-document-mapper
@romseygeek romseygeek merged commit dbd33f7 into elastic:master Oct 30, 2019
@romseygeek romseygeek deleted the types-removal/mapper-service-document-mapper branch October 30, 2019 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>refactoring :Search Foundations/Mapping Index mappings, including merging and defining field types v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants