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

Rename Mapper#simpleName to Mapper#leafName #110030

Merged

Conversation

javanna
Copy link
Member

@javanna javanna commented Jun 21, 2024

This addresses a long standing TODO that caused quite a few bugs over time, in that the mapper name does not include its full path, while the MappedFieldType name does. We have method called simpleName to signal that, but leafName signals that more clearly and aligns with the name we have recently introduced in Mapper.Builder (renamed from name to leafName).

Note that this will require adjustments for plugin developers that implement custom mappers. They will need to switch from using simpleName() to leafName() in their code.

Relates to #109971

This addresses a long standing TODO that caused quite a few bugs over time, in that the mapper name does not include its full path, while
the MappedFieldType name does. We have method called simpleName to signal that, but leafName signals that more clearly and aligns with
the name we have recently introduced in Mapper.Builder (renamed from name to leafName).

Relates to elastic#109971
@javanna javanna added :Search Foundations/Mapping Index mappings, including merging and defining field types >breaking-java >refactoring v8.15.0 labels Jun 21, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Search Meta label for search team label Jun 21, 2024
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Member

@piergm piergm left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@javanna javanna merged commit 54e7b4d into elastic:main Jun 21, 2024
15 checks passed
@javanna javanna deleted the refactoring/mapper_simple_name_leaf_name branch June 21, 2024 12:28
javanna added a commit to javanna/elasticsearch that referenced this pull request Jun 21, 2024
This addresses a long standing TODO that caused quite a few bugs over time, in that the mapper name does not include its full path, while the MappedFieldType name does.

We have renamed Mapper.Builder#name to leafName (elastic#109971) and Mapper#simpleName to leafName (elastic#110030). This commit renames Mapper#name to fullPath for clarity
This required some adjustments in FieldAliasMapper to avoid confusion between the existing path method and fullPath. I renamed path to targetPath for clarity.
ObjectMapper already had a fullPath method that returned name, and was effectively a copy of name, so it could be removed.
javanna added a commit that referenced this pull request Jun 21, 2024
This addresses a long standing TODO that caused quite a few bugs over time, in that the mapper name does not include its full path, while the MappedFieldType name does.

We have renamed Mapper.Builder#name to leafName (#109971) and Mapper#simpleName to leafName (#110030). This commit renames Mapper#name to fullPath for clarity
This required some adjustments in FieldAliasMapper to avoid confusion between the existing path method and fullPath. I renamed path to targetPath for clarity.
ObjectMapper already had a fullPath method that returned name, and was effectively a copy of name, so it could be removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>breaking-java >refactoring :Search Foundations/Mapping Index mappings, including merging and defining field types Team:Search Meta label for search team v8.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants