Skip to content

Release 5.4.4 Problem in Class MappingElasticsearchConverter Sort field name auto changed #3086

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

Closed
s-h-o-g-u-n opened this issue Apr 1, 2025 · 1 comment
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@s-h-o-g-u-n
Copy link

s-h-o-g-u-n commented Apr 1, 2025

Method updatePropertiesInFieldsSortAndSourceFilter auto changes a Sort Field from ad.home.price.value to ad.home.price, because the attribute value is type MonetaryAmount, which is an interface.

private MonetaryAmount price;

"price": {
      "properties": {
          "unit": {
              "type": "text",
              "fields": {
                  "keyword": {
                      "type": "keyword",
                      "ignore_above": 256
                  }
              }
          },
          "value": {
              "type": "float"
          }
      }
  }

MonetaryAmount Mapping is done via ElasticsearchCustomConversions.

detailed error:
Method getPersistentEntity returns null, because persistentProperty:price isn’t an entity;

if (!persistentProperty.isEntity()) {
        return null;
}

@Override
public boolean isEntity() {
	return !isTransient() && !entityTypeInformation.get().isEmpty(); // isEmpty() is here TRUE!
}

persistentProperty.getTypeInformation() from price is javax.money.MonetaryAmount

Is there a way to temporarily set the type information externally or an other workaround?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 1, 2025
@sothawo
Copy link
Collaborator

sothawo commented Apr 2, 2025

this is a duplicate of #3081

@sothawo sothawo closed this as completed Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants