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

Support naming strategy between ES index mapping and Java object #1729

Closed
weweibuy opened this issue Mar 15, 2021 · 2 comments
Closed

Support naming strategy between ES index mapping and Java object #1729

weweibuy opened this issue Mar 15, 2021 · 2 comments

Comments

@weweibuy
Copy link

Sometimes ES index mapping naming strategy is SNAKE_CASE like:
{ "mapping": { "properties": { "customer_id": { "type": "long" }, "order_no": { "type": "keyword" } } } }
but Java object is LOWER_CAMEL_CASE like:

`public class Order {

        private Long customerId;

        private String orderNo;
    }`

In spring-data-elasticsearch 3x, we can use @JsonNaming or replace implements of org.springframework.data.elasticsearch.core.EntityMapper with SNAKE_CASE naming strategy ObjectMapper to map or read Java object;

In future spring-data-elasticsearch , Can it support:

  • config global naming strategy between ES index mapping and Java object
  • customized config for each ES index, like @JsonNaming in spring-data-elasticsearch 3x
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 15, 2021
@sothawo sothawo removed the status: waiting-for-triage An issue we've not yet triaged label Mar 15, 2021
@sothawo
Copy link
Collaborator

sothawo commented Mar 15, 2021

Implemented with #1565, available since version 4.2.0.M3

@sothawo sothawo closed this as completed Mar 15, 2021
@sothawo
Copy link
Collaborator

sothawo commented Mar 15, 2021

additional info: this is an application wide configuration currently. To have it configurable for individual entites would be something new.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants